Sha256: e059b5b5339beba509fdf2585523d4fad685b6005425e4f9523a01e6e521d275

Contents?: true

Size: 830 Bytes

Versions: 2

Compression:

Stored size: 830 Bytes

Contents

class ActiveRecord::AssociatedObject::Railtie < Rails::Railtie
  initializer "integrations.include" do
    config.after_initialize do
      ActiveRecord::AssociatedObject.include Kredis::Attributes       if defined?(Kredis)
      ActiveRecord::AssociatedObject.include GlobalID::Identification if defined?(GlobalID)

      ActiveSupport.on_load :active_job do
        require "active_job/performs"
        ActiveRecord::AssociatedObject.extend ActiveJob::Performs
      rescue LoadError
        # We haven't bundled active_job-performs, so we're continuing without it.
      end
    end
  end

  initializer "object_association.setup" do
    ActiveSupport.on_load :active_record do
      require "active_record/associated_object/object_association"
      extend ActiveRecord::AssociatedObject::ObjectAssociation
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_record-associated_object-0.5.1 lib/active_record/associated_object/railtie.rb
active_record-associated_object-0.5.0 lib/active_record/associated_object/railtie.rb