Sha256: ac686928965f94c1a205a59b713f29ecb8f7ff87223089da37da2f1d3c27d30e

Contents?: true

Size: 487 Bytes

Versions: 6

Compression:

Stored size: 487 Bytes

Contents

module ActiveRecord::Duplicate
  if defined?(Rails::Railtie)
    require 'rails'

    class Railtie < Rails::Railtie
      initializer 'activerecord-duplicate.insert_into_active_record' do
        ActiveSupport.on_load(:active_record) do
          ActiveRecord::Duplicate::Railtie.insert
        end
      end
    end
  end

  class Railtie
    def self.insert
      if defined?(ActiveRecord)
        ActiveRecord::Base.send(:include, ActiveRecord::Duplicate)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activerecord-duplicate-0.6.1 lib/activerecord-duplicate/railtie.rb
activerecord-duplicate-0.6.0 lib/activerecord-duplicate/railtie.rb
activerecord-duplicate-0.5.1 lib/activerecord-duplicate/railtie.rb
activerecord-duplicate-0.5.0 lib/activerecord-duplicate/railtie.rb
activerecord-duplicate-0.4.2 lib/activerecord-duplicate/railtie.rb
activerecord-duplicate-0.4.1 lib/active_record-duplicate/railtie.rb