pragma
pragma copied to clipboard
Model(): Support lookup by custom attributes
We should support the following formats:
step Model(invoice_id: :id) # WHERE invoice_id = params[:invoice_id] AND id = params[:id]
step Model(:id) # WHERE id = params[:id]
step Model(:slug, :id) # WHERE slug = params[:id] OR id = params[:id]
This has actually been introduced in TRB itself in trailblazer-macro, so we can just wait for 2.1.