# Acts\_as\_list nested scope

**URL:** <https://www.ruby-forum.com/t/acts-as-list-nested-scope/90446>\
**Category:** Rails\
**Created:** [March 28, 2007, 10:16pm UTC](https://www.ruby-forum.com/t/acts-as-list-nested-scope/90446 "2007-03-28T22:16:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jruyle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@jruyle](https://www.ruby-forum.com/u/jruyle)\
**Post date:** [March 28, 2007, 10:16pm UTC](https://www.ruby-forum.com/t/acts-as-list-nested-scope/90446/1 "2007-03-28T22:16:31Z")

</div>

Here’s what I’m trying to do:

class Model \< AR::Base  
acts\_as\_list :scope =\> [:key\_one\_id, :key\_two\_id, :key\_three\_id]  
end

with the idea being that there are these three references from this  
table  
(one of them being optional) that define the list. I don’t think acts as  
nested set works in this situation because I’m still just dealing with a  
single list per these three keys; there are no children or parents to  
speak  
of.

Is this easily possible or should I look into changing acts\_as\_list to  
work  
this way?

Jason

---

<div class="post-metadata">

**Author:** ![jruyle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@jruyle](https://www.ruby-forum.com/u/jruyle)\
**Post date:** [March 28, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/acts-as-list-nested-scope/90446/2 "2007-03-28T23:10:39Z")

</div>

Actually, nevermind. I was going about the problem the wrong way. Proper  
way:

class Model \< AR::Base  
has\_many :model\_items

# also holds :key\_one\_id, :key\_two\_id, :key\_three\_id

end

class ModelItem \< AR::Base  
belongs\_to :model  
acts\_as\_list :scope =\> :model\_id  
end

Much, much cleaner.

Jason
