diff options
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/association.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/singular_association.rb | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations/association.rb b/activerecord/lib/active_record/associations/association.rb index fb205d9ba5..5d0927f17d 100644 --- a/activerecord/lib/active_record/associations/association.rb +++ b/activerecord/lib/active_record/associations/association.rb @@ -190,9 +190,7 @@ module ActiveRecord end binds = AssociationScope.get_bind_values(owner, reflection.chain) - sc.execute(binds, conn) do |record| - set_inverse_instance(record) - end + sc.execute(binds, conn) { |record| set_inverse_instance(record) } || [] end # The scope for this association. diff --git a/activerecord/lib/active_record/associations/singular_association.rb b/activerecord/lib/active_record/associations/singular_association.rb index c296f9882e..a92932fa4b 100644 --- a/activerecord/lib/active_record/associations/singular_association.rb +++ b/activerecord/lib/active_record/associations/singular_association.rb @@ -37,8 +37,6 @@ module ActiveRecord def find_target super.first - rescue ::RangeError - nil end def replace(record) |