Commit c33f3a65 by John Hawthorn

Use paranoia_destroyed? instead of deleted?

parent 42cb1df7
......@@ -5,8 +5,8 @@ module HandleParanoiaDestroyedInBelongsToAssociation
case options[:dependent]
when :destroy
target.destroy
if defined? target.deleted?
raise ActiveRecord::Rollback unless target.deleted?
if target.respond_to?(:paranoia_destroyed?)
raise ActiveRecord::Rollback unless target.paranoia_destroyed?
else
raise ActiveRecord::Rollback unless target.destroyed?
end
......@@ -25,8 +25,8 @@ module HandleParanoiaDestroyedInHasOneAssociation
when :destroy
target.destroyed_by_association = reflection
target.destroy
if defined? target.deleted?
throw(:abort) unless target.deleted?
if target.respond_to?(:paranoia_destroyed?)
throw(:abort) unless target.paranoia_destroyed?
else
throw(:abort) unless target.destroyed?
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment