Also clear the destroyed flag after synchronizing.
This commit is contained in:
parent
413e35fedd
commit
9fd19a36bd
|
@ -43,7 +43,10 @@ module ActiveRecord # :nodoc:
|
||||||
instance.clear_aggregation_cache
|
instance.clear_aggregation_cache
|
||||||
instance.clear_association_cache
|
instance.clear_association_cache
|
||||||
instance.instance_variable_set '@attributes', matched_instance.attributes
|
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 '@new_record', false
|
||||||
|
instance.instance_variable_set '@destroyed', false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue