Confused by acts_as_list documentation


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.

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs