diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-05-27 14:36:18 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2017-05-27 14:36:18 +0200 |
commit | fcc47bcfccc7578aa0414710eecdad006085a911 (patch) | |
tree | d09cad16eed4c367ddd809a9699da265ca821830 /activerecord/lib/active_record/associations/foreign_association.rb | |
parent | 3a131b6c008eed58fddfa23f2787d9eef657331a (diff) | |
download | rails-fcc47bcfccc7578aa0414710eecdad006085a911.tar.gz rails-fcc47bcfccc7578aa0414710eecdad006085a911.tar.bz2 rails-fcc47bcfccc7578aa0414710eecdad006085a911.zip |
Use non-raising finder.
`find` raises when it can't find a record, so we'll never reach the
else. Switch to `find_by` which returns nil when no record can be
found.
Diffstat (limited to 'activerecord/lib/active_record/associations/foreign_association.rb')
0 files changed, 0 insertions, 0 deletions