Rails have method where which returns Relation and find method which accepts entity and looks based on primary (you shouldn't specify it explicit).
Is there any where method which accepts entity?
eg, User.where(params[:id])
-> select .. from users where user.id = ...