From 023227d78dd1f3b5e30c495b18330885e2daffc4 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 14 Jan 2005 01:24:57 +0000 Subject: Changed add_to_list_top and add_to_list_bottom to be public git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/acts/list.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/acts/list.rb b/activerecord/lib/active_record/acts/list.rb index b5cffbb427..285b371a72 100644 --- a/activerecord/lib/active_record/acts/list.rb +++ b/activerecord/lib/active_record/acts/list.rb @@ -100,6 +100,14 @@ 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 @@ -135,14 +143,6 @@ module ActiveRecord end private - def add_to_list_top - increment_positions_on_all_items - end - - def add_to_list_bottom - write_attribute(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 @@ -159,11 +159,11 @@ module ActiveRecord end def assume_bottom_position - update_attribute position_column, bottom_position_in_list.to_i + 1 + update_attribute(position_column, bottom_position_in_list.to_i + 1) end def assume_top_position - update_attribute position_column, 1 + update_attribute(position_column, 1) end def decrement_positions_on_lower_items -- cgit v1.2.3