Forum: Ruby on Rails acts_as_tree with acts_as_list

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Brian B. (Guest)
on 2007-01-25 21:26
(Received via mailing list)
Hello all,

I'm having trouble using acts_as_list with acts_as_tree
to order the "children". I've found a few old posts on the web
that seem to indicate that this once worked.

class Whatever < ActiveRecord::Base
  acts_as_tree :order => :position
  acts_as_list :scope => :parent_id

Although the 'position' field is being populated,
it appears to be ignoring the :scope.
This is happening in rel_1-2-1 and edge.

Is anyone currently using this configuration?
Any ideas?

As a side note, the :scope on acts_as_list doesn't work
if it is passed as a string, but does work if using a symbol.
A ticket/patch has been posted. http://dev.rubyonrails.org/ticket/7380
However, this does not solve the above problem :)

Thanks!
- Brian
Brian B. (Guest)
on 2007-01-26 06:49
(Received via mailing list)
Nevermind... it's working perfectly.
The position ids generated by my tests were throwing me off.
Writing more extensive tests has shown me the light :)

- Brian
This topic is locked and can not be replied to.