Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
ActiveSupport.on_load
to hook into ActiveRecord (#272)
* Use `ActiveSupport.on_load` to hook into ActiveRecord * Remove the need for a concern In our case it’s fairly simple to just call `extend` to bring in the class method. The instance methods are then included when `acts_as_list` is called. `active_record` also has `active_support` as a dependency so we don’t need to declare that.
- Loading branch information
Showing
4 changed files
with
71 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
require 'acts_as_list/active_record/acts/list' | ||
require "acts_as_list/active_record/acts/list" | ||
require "acts_as_list/active_record/acts/position_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/no_update' | ||
require "acts_as_list/active_record/acts/no_update" | ||
require "acts_as_list/active_record/acts/sequential_updates_method_definer" | ||
require "acts_as_list/active_record/acts/active_record" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ActiveSupport.on_load :active_record do | ||
extend ActiveRecord::Acts::List::ClassMethods | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters