From f1a15c2197d5da8e0c38bd59aa19973c9cfc0a01 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Sun, 16 Jan 2011 19:47:58 +0000 Subject: Abstract a bit more into SingularAssociation --- activerecord/lib/active_record/associations/belongs_to_association.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/associations/belongs_to_association.rb') diff --git a/activerecord/lib/active_record/associations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb index 11e16de738..271112bbe1 100644 --- a/activerecord/lib/active_record/associations/belongs_to_association.rb +++ b/activerecord/lib/active_record/associations/belongs_to_association.rb @@ -3,8 +3,7 @@ module ActiveRecord module Associations class BelongsToAssociation < SingularAssociation #:nodoc: def replace(record) - record = record.target if AssociationProxy === record - raise_on_type_mismatch(record) if record + record = check_record(record) update_counters(record) replace_keys(record) -- cgit v1.2.3