confused by acts_as_list documentation

Hi,

http://api.rubyonrails.org/classes/ActiveRecord/Acts/List/ClassMethods.html

I try to play with acts_as_list feature and I don't understand these lines: todo_list.first.move_to_bottom todo_list.last.move_higher

todo_list is supposed to be an instance from TodoList class. But there is no method 'first' on this class. Yes, move_to_bottom and move_higher is working as expected. But it is must be like this: temp_todo_item = todo_list.todo_items.first temp_todo_item.move_to_bottom

Is it documentation bug or am I misunderstanding the documentation?

Thank you.

Good question.

first is a method built into Ruby. http://rdoc.sourceforge.net/doc/classes/Range.html#M000007

Rails objects have a first method, because they are Ruby objects. It is not defined in the Rails source code here: http://svn.rubyonrails.org/rails/trunk/activerecord/lib/active_record/base.rb

Sean