diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/singular_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/singular_association.rb b/activerecord/lib/active_record/associations/singular_association.rb index 483a9df740..e386cc0e4c 100644 --- a/activerecord/lib/active_record/associations/singular_association.rb +++ b/activerecord/lib/active_record/associations/singular_association.rb @@ -48,9 +48,9 @@ module ActiveRecord end binds = AssociationScope.get_bind_values(owner, reflection.chain) - if record = sc.execute(binds, klass, conn).first + sc.execute(binds, klass, conn) do |record| set_inverse_instance record - end + end.first end def replace(record) |