Created
April 8, 2011 18:52
-
-
Save tiegz/910479 to your computer and use it in GitHub Desktop.
acts_as_list fix
This file contains hidden or 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
# config/initializers/acts_as_list.rb | |
module ActsAsList::InstanceMethods | |
private | |
# change acts_as_list to *only* move a new record to bottom if 'position' value is blank | |
def add_to_list_bottom_with_check | |
add_to_list_bottom_without_check if new_record? && self[position_column].blank? | |
end | |
alias_method_chain :add_to_list_bottom, :check | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment