Also clear the destroyed flag after synchronizing.

master
Doug Orleans 2012-09-03 02:32:49 -04:00 committed by Zach Dennis
parent 413e35fedd
commit 9fd19a36bd
1 changed files with 3 additions and 0 deletions

View File

@ -43,7 +43,10 @@ module ActiveRecord # :nodoc:
instance.clear_aggregation_cache
instance.clear_association_cache
instance.instance_variable_set '@attributes', matched_instance.attributes
# Since the instance now accurately reflects the record in
# the database, ensure that instance.persisted? is true.
instance.instance_variable_set '@new_record', false
instance.instance_variable_set '@destroyed', false
end
end
end