Skip to content

Commit

Permalink
Improve load method (brendon#240)
Browse files Browse the repository at this point in the history
* Refactor loading sequence
* Fix failing tests
  • Loading branch information
brendon authored Nov 26, 2016
1 parent f0aeaf8 commit 4abf137
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 228 deletions.
20 changes: 6 additions & 14 deletions lib/acts_as_list.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
require "acts_as_list/active_record/acts/column_method_definer"
require "acts_as_list/active_record/acts/scope_method_definer"
require "acts_as_list/active_record/acts/top_of_list_method_definer"
require "acts_as_list/active_record/acts/add_new_at_method_definer"
require "acts_as_list/active_record/acts/aux_method_definer"
require "acts_as_list/active_record/acts/callback_definer"
require 'acts_as_list/active_record/acts/list'

module ActsAsList
if defined?(Rails::Railtie)
class Railtie < Rails::Railtie
initializer 'acts_as_list.insert_into_active_record' do
ActiveSupport.on_load :active_record do
ActiveRecord::Base.send(:include, ActiveRecord::Acts::List)
end
end
end
else
ActiveRecord::Base.send(:include, ActiveRecord::Acts::List) if defined?(ActiveRecord)
end
end
Loading

0 comments on commit 4abf137

Please sign in to comment.