# File lib/dm-core/associations/one_to_many.rb, line 118 def replace(other) assert_mutable each { |resource| orphan_resource(resource) } other = other.map { |resource| resource.kind_of?(Hash) ? new_child(resource) : resource } children.replace(other) other.each { |resource| relate_resource(resource) } self end