aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/preloader
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-12-12 11:19:32 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2013-12-12 11:19:32 -0800
commitc76549d6de3716782d227c370a2169450274ed97 (patch)
treeef980772ba53feba22b3fc9f7357f78baf3ade70 /activerecord/lib/active_record/associations/preloader
parentda3891c898fd79ab28dad3ce4c9e52d876c9e4e9 (diff)
downloadrails-c76549d6de3716782d227c370a2169450274ed97.tar.gz
rails-c76549d6de3716782d227c370a2169450274ed97.tar.bz2
rails-c76549d6de3716782d227c370a2169450274ed97.zip
remove the nil check from set_inverse_instance
methods that call set_inverse_instance with a record will not have to pay the cost of a nil check on every call
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader')
-rw-r--r--activerecord/lib/active_record/associations/preloader/singular_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/singular_association.rb b/activerecord/lib/active_record/associations/preloader/singular_association.rb
index 2b5cfda8ce..f60647a81e 100644
--- a/activerecord/lib/active_record/associations/preloader/singular_association.rb
+++ b/activerecord/lib/active_record/associations/preloader/singular_association.rb
@@ -11,7 +11,7 @@ module ActiveRecord
association = owner.association(reflection.name)
association.target = record
- association.set_inverse_instance(record)
+ association.set_inverse_instance(record) if record
end
end