diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-14 01:24:57 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-14 01:24:57 +0000 |
commit | 023227d78dd1f3b5e30c495b18330885e2daffc4 (patch) | |
tree | 0561e5b2288d5c0c39a189b6a36c6613352992d5 /activerecord/lib | |
parent | 52251baae48cf25ea06106569af3d04c76841210 (diff) | |
download | rails-023227d78dd1f3b5e30c495b18330885e2daffc4.tar.gz rails-023227d78dd1f3b5e30c495b18330885e2daffc4.tar.bz2 rails-023227d78dd1f3b5e30c495b18330885e2daffc4.zip |
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
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/acts/list.rb | 20 |
1 files changed, 10 insertions, 10 deletions
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 |