We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This was an idea from @avdi:
https://twitter.com/avdi/status/1202702640397856768?ref_src=twsrc%5Etfw
Idea for a Rails linting rule: every AR find must either be in a conditional or be a bang Either: widget = Widget.find_by! color: "green" Or if(widget = Widget.find_by color: "green") # ... There's no reason to ever leave the discovery of a nil for later. Is there?
Idea for a Rails linting rule: every AR find must either be in a conditional or be a bang
Either:
widget = Widget.find_by! color: "green"
Or
if(widget = Widget.find_by color: "green") # ...
There's no reason to ever leave the discovery of a nil for later. Is there?
There's some interesting discussion in the replies.
It's similar to the existing SaveBang rule.
The text was updated successfully, but these errors were encountered:
I wonder if this can be generalized to Rails style guide coding rule before creating a new cop. I will transfer this issue to the style guide repo.
Sorry, something went wrong.
No branches or pull requests
This was an idea from @avdi:
https://twitter.com/avdi/status/1202702640397856768?ref_src=twsrc%5Etfw
There's some interesting discussion in the replies.
It's similar to the existing SaveBang rule.
The text was updated successfully, but these errors were encountered: