All the methods available to a record that has had acts_as_list specified. Each method works by assuming the object to be the item in the list, so chapter.move_lower would move that chapter lower in the list of all chapters. Likewise, chapter.first? would return true if that chapter is the first in the list of all chapters.

Methods
Public Instance methods
decrement_position()

Decrease the position of this item without adjusting the rest of the list.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 138
138:         def decrement_position
139:           return unless in_list?
140:           update_attribute position_column, self.send(position_column).to_i - 1
141:         end
first?()

Return true if this object is the first in the list.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 144
144:         def first?
145:           return false unless in_list?
146:           self.send(position_column) == 1
147:         end
higher_item()

Return the next higher item in the list.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 156
156:         def higher_item
157:           return nil unless in_list?
158:           acts_as_list_class.find(:first, :conditions =>
159:             "#{scope_condition} AND #{position_column} = #{(send(position_column).to_i - 1).to_s}"
160:           )
161:         end
in_list?()

Test if this record is in a list

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 172
172:         def in_list?
173:           !send(position_column).nil?
174:         end
increment_position()

Increase the position of this item without adjusting the rest of the list.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 132
132:         def increment_position
133:           return unless in_list?
134:           update_attribute position_column, self.send(position_column).to_i + 1
135:         end
insert_at(position = 1)

Insert the item at the given position (defaults to the top position of 1).

    # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 79
79:         def insert_at(position = 1)
80:           insert_at_position(position)
81:         end
last?()

Return true if this object is the last in the list.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 150
150:         def last?
151:           return false unless in_list?
152:           self.send(position_column) == bottom_position_in_list
153:         end
lower_item()

Return the next lower item in the list.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 164
164:         def lower_item
165:           return nil unless in_list?
166:           acts_as_list_class.find(:first, :conditions =>
167:             "#{scope_condition} AND #{position_column} = #{(send(position_column).to_i + 1).to_s}"
168:           )
169:         end
move_higher()

Swap positions with the next higher item, if one exists.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 94
 94:         def move_higher
 95:           return unless higher_item
 96: 
 97:           acts_as_list_class.transaction do
 98:             higher_item.increment_position
 99:             decrement_position
100:           end
101:         end
move_lower()

Swap positions with the next lower item, if one exists.

    # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 84
84:         def move_lower
85:           return unless lower_item
86: 
87:           acts_as_list_class.transaction do
88:             lower_item.decrement_position
89:             increment_position
90:           end
91:         end
move_to_bottom()

Move to the bottom of the list. If the item is already in the list, the items below it have their position adjusted accordingly.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 105
105:         def move_to_bottom
106:           return unless in_list?
107:           acts_as_list_class.transaction do
108:             decrement_positions_on_lower_items
109:             assume_bottom_position
110:           end
111:         end
move_to_top()

Move to the top of the list. If the item is already in the list, the items above it have their position adjusted accordingly.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 115
115:         def move_to_top
116:           return unless in_list?
117:           acts_as_list_class.transaction do
118:             increment_positions_on_higher_items
119:             assume_top_position
120:           end
121:         end
remove_from_list()

Removes the item from the list.

     # File vendor/rails/activerecord/lib/active_record/acts/list.rb, line 124
124:         def remove_from_list
125:           if in_list?
126:             decrement_positions_on_lower_items
127:             update_attribute position_column, nil
128:           end
129:         end