Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove more nil checks

  • Loading branch information...
commit 93ee9f0cba607f1050610cddcfa509e5faa7e731 1 parent 1678e95
@tenderlove tenderlove authored
View
11 activerecord/lib/active_record/associations/belongs_to_association.rb
@@ -8,17 +8,16 @@ def handle_dependency
end
def replace(record)
- raise_on_type_mismatch!(record) if record
-
- update_counters(record)
if record
+ raise_on_type_mismatch!(record)
+ update_counters(record)
replace_keys(record)
+ set_inverse_instance(record)
+ @updated = true
else
+ update_counters(record)
remove_keys
end
- set_inverse_instance(record) if record
-
- @updated = true if record
self.target = record
end
Please sign in to comment.
Something went wrong with that request. Please try again.