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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
sean.seanlynch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-01 15:47 UTC
Re: confused by acts_as_list documentation
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 On May 1, 9:41 am, rinda <akbarh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > http://api.rubyonrails.org/classes/ActiveRecord/Acts/List/ClassMethod... > > 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.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---