I have the following in a controller
def update @permission = Permission.find_by_user_id(params[:user_id])
But I want it to also find by a
Rails 3 way with scopes:
scope :by_user_id_and_project_id, lambda {|user_id,project_id| where(:user_id=>user_id).where(:project_id=>project_id]) }
And then you can use it like:
@permission = Permission.by_user_id_and_project_id(params[:user_id],params[:project_id])