aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/belongs_to_association.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb
index 391471849c..b5545f4084 100644
--- a/activerecord/lib/active_record/associations/belongs_to_association.rb
+++ b/activerecord/lib/active_record/associations/belongs_to_association.rb
@@ -12,7 +12,7 @@ module ActiveRecord
def replace(record)
record = record.target if AssociationProxy === record
- raise_on_type_mismatch(record) unless record.nil?
+ raise_on_type_mismatch(record) if record
update_counters(record)
replace_keys(record)
@@ -59,7 +59,7 @@ module ActiveRecord
end
def foreign_key_present?
- !@owner[@reflection.foreign_key].nil?
+ @owner[@reflection.foreign_key]
end
# NOTE - for now, we're only supporting inverse setting from belongs_to back onto