# Acts\_as\_list with scope of current\_user? possible?

**URL:** <https://www.ruby-forum.com/t/acts-as-list-with-scope-of-current-user-possible/129998>\
**Category:** Rails\
**Created:** [February 24, 2008, 1:05am UTC](https://www.ruby-forum.com/t/acts-as-list-with-scope-of-current-user-possible/129998 "2008-02-24T01:05:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbee-robert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/dbc845/32.png) [@newbee-robert](https://www.ruby-forum.com/u/newbee-robert)\
**Post date:** [February 24, 2008, 1:05am UTC](https://www.ruby-forum.com/t/acts-as-list-with-scope-of-current-user-possible/129998/1 "2008-02-24T01:05:01Z")

</div>

Subject says it all. Is it possible to user the current\_user variable  
from the acts as authenticated and restful authentication plugin in the  
scope call of an acts as list on the model?

---

<div class="post-metadata">

**Author:** ![newbee-robert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/dbc845/32.png) [@newbee-robert](https://www.ruby-forum.com/u/newbee-robert)\
**Post date:** [February 24, 2008, 1:31am UTC](https://www.ruby-forum.com/t/acts-as-list-with-scope-of-current-user-possible/129998/2 "2008-02-24T01:31:01Z")

</div>

Robert M. wrote:

> Subject says it all. Is it possible to user the current\_user variable  
> from the acts as authenticated and restful authentication plugin in the  
> scope call of an acts as list on the model?

the current\_user method in the acts\_as\_authenticated plugin is not a db  
field so the acts\_as\_list won’t work with this method (not “user  
variable” as you mentioned). It will work however with the :user\_id in  
the model users and yes, you can scope the users any way you want…

In the container for your users, whether it’s a “group”, “club”,  
“party”, etc… do

class Party \< ActiveRecord::Base  
has\_many :users, :order =\> position  
end

class User \< ActiveRecord::Base  
belongs\_to :party, :scope =\> party\_id  
end

hth

ilan
