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?
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