as an example, i have a model Group and model User
they are connected with :has_many, :through => groups_users
groups_users table has an attribute, called moderator, specifying whether a user is a moderator of the group
question: how do i access all moderators of a given group?
after reading about :with_scope, what comes to mind is
def find_moderators
Group.with_scope(:find=>{:conditions => "moderator=1"})
@[email protected]
end
end
However, after rails 2, with_scope becomes protected, and doesn't allow given code in the controller, so What is the good alternative to that?