Sha256: e2a15dc242e4505d5a8f19311614450104a5b2cb5d412a92644788e8d2f6bc0c

Contents?: true

Size: 526 Bytes

Versions: 6

Compression:

Stored size: 526 Bytes

Contents

require 'acts_as_list/active_record/acts/list'

module ActsAsList
  if defined? Rails::Railtie
    require 'rails'
    class Railtie < Rails::Railtie
      initializer 'acts_as_list.insert_into_active_record' do
        ActiveSupport.on_load :active_record do
          ActsAsList::Railtie.insert
        end
      end
    end
  end

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

ActsAsList::Railtie.insert

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
acts_as_list-0.4.0 lib/acts_as_list.rb
acts_as_list-0.3.0 lib/acts_as_list.rb
acts_as_list-0.2.0 lib/acts_as_list.rb
acts_as_list-0.1.9 lib/acts_as_list.rb
acts_as_list-0.1.8 lib/acts_as_list.rb
acts_as_list-0.1.7 lib/acts_as_list.rb