Open
Description
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?
There's some interesting discussion in the replies.
It's similar to the existing SaveBang rule.
Metadata
Metadata
Assignees
Labels
No labels