aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/acts/list.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/acts/list.rb b/activerecord/lib/active_record/acts/list.rb
index 285b371a72..8232ea2852 100644
--- a/activerecord/lib/active_record/acts/list.rb
+++ b/activerecord/lib/active_record/acts/list.rb
@@ -100,14 +100,6 @@ module ActiveRecord
end
- def add_to_list_top
- increment_positions_on_all_items
- end
-
- def add_to_list_bottom
- assume_bottom_position
- end
-
def remove_from_list
decrement_positions_on_lower_items
end
@@ -143,6 +135,14 @@ module ActiveRecord
end
private
+ def add_to_list_top
+ increment_positions_on_all_items
+ end
+
+ def add_to_list_bottom
+ self[position_column] = bottom_position_in_list.to_i + 1
+ end
+
# Overwrite this method to define the scope of the list changes
def scope_condition() "1" end