Forum: Ruby on Rails confused by acts_as_list documentation

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
05337aed68267daec2996e5ca732d476?d=identicon&s=25 Akbar Home (rinda)
on 2007-05-01 16:42
(Received via mailing list)

I try to play with acts_as_list feature and I don't understand these

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

Is it documentation bug or am I misunderstanding the documentation?

Thank you.
8716cce9a7b721786e5425b8cc1f9951?d=identicon&s=25 unknown (Guest)
on 2007-05-01 17:49
(Received via mailing list)
Good question.

first is a method built into Ruby.

Rails objects have a first method, because they are Ruby objects. It
is not defined in the Rails source code here:

This topic is locked and can not be replied to.