Skip to content

Commit

Permalink
Changed add_to_list_top and add_to_list_bottom to be public
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Jan 14, 2005
1 parent 52251ba commit 023227d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions activerecord/lib/active_record/acts/list.rb
Expand Up @@ -100,6 +100,14 @@ def move_to_top
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
Expand Down Expand Up @@ -135,14 +143,6 @@ def lower_item
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

Expand All @@ -159,11 +159,11 @@ def bottom_item
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
Expand Down

0 comments on commit 023227d

Please sign in to comment.