# File lib/data_mapper/constraints/relationship/one_to_many.rb, line 9 def enforce_destroy_constraint(resource) return true unless association = get(resource) constraint = self.constraint case constraint when :protect Array(association).empty? when :destroy, :destroy! association.__send__(constraint) when :set_nil Array(association).all? do |resource| resource.update(inverse => nil) end when :skip true # do nothing end end