-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It might be worth to see if possible or just makes sense to add a scope_by key in the Model arguments.
This comes from experience where people prefer to do this:
step :set_model
def set_model(ctx, params:, current_user:, **)
ctx[:model] = current_user.broadacsts.find_by(id: params[:id)
end
Over
step Model(Broadcast, :find_by)
Simply for "security" reason.
So this is what we could have:
step Model(Broadcast, :find_by, scope_by: :current_user)
where current_user is passed in ctx -> ctx[:current_user]
We add a step to extract the scope with failure end similar on what is done in Contract::Validate.
Should we think to add this or not really?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request