Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model(): Support lookup by custom attributes #13

Open
aldesantis opened this issue Dec 17, 2017 · 1 comment
Open

Model(): Support lookup by custom attributes #13

aldesantis opened this issue Dec 17, 2017 · 1 comment

Comments

@aldesantis
Copy link
Member

aldesantis commented Dec 17, 2017

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]
@aldesantis aldesantis changed the title Allow Model to find records by attributes different from ID Model(): Allow custom attributes Feb 1, 2018
@aldesantis aldesantis changed the title Model(): Allow custom attributes Model(): Support lookup by custom attributes Feb 1, 2018
@aldesantis
Copy link
Member Author

This has actually been introduced in TRB itself in trailblazer-macro, so we can just wait for 2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant