Sha256: 651c752d82f7b3a2df469c12af050aea45a5eae443ec3ef4461502b7720428c1

Contents?: true

Size: 535 Bytes

Versions: 35

Compression:

Stored size: 535 Bytes

Contents

module Scorpion
  module Rails
    module ActiveRecord

      # Adds dependency injection to ActiveRecord::Base models.
      module Model
        include Scorpion::Stinger

        def self.prepended( base )
          # Setup dependency injection
          base.send :include, Scorpion::Object
          base.singleton_class.class_exec do
            delegate :with_scorpion, to: :all
          end

          super
        end

        def association( *args, &block )
          sting! super
        end

      end

    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
scorpion-ioc-1.0.10 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-1.0.8 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-1.0.7 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-1.0.6 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-1.0.4 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-1.0.3 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-1.0.2 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-1.0.1 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-1.0.0 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.6.2 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.6.1 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.6.0 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.5.23 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.5.22 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.5.21 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.5.20 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.5.19 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.5.18 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.5.17 lib/scorpion/rails/active_record/model.rb
scorpion-ioc-0.5.16 lib/scorpion/rails/active_record/model.rb