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 4 introduces the find_by method:
Permission.find_by(user_id: params[:user_id], project_id: params[:project_id])