Skip to content
This repository
tree: f62c43265f
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 25 lines (21 sloc) 0.526 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
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
Something went wrong with that request. Please try again.