Sha256: 308836cb6d89d96b1832abae4051afc7ebc65c858d6fa7d2e32dcaa9e5c51bc2

Contents?: true

Size: 556 Bytes

Versions: 1

Compression:

Stored size: 556 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.send :extend, ClassMethods
          super
        end

        module ClassMethods
          delegate :with_scorpion, to: :all
        end

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

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scorpion-ioc-0.4.0 lib/scorpion/rails/active_record/model.rb