Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
resca79
· 11y ago · 0 comments
If you are talking about ActiveRecord methods, `find_by_id(123)` or `find_by("id", 123)` are a little bit wrong both, you should use a simple `find(123)`
Comments
[–]
venus
11y ago
find_by_id/find_by aren't "wrong", they're just different. Sometimes you want to fall back to nil instead of raising an exception.