Commit c33f3a65 by John Hawthorn

Use paranoia_destroyed? instead of deleted?

parent 42cb1df7
...@@ -5,8 +5,8 @@ module HandleParanoiaDestroyedInBelongsToAssociation ...@@ -5,8 +5,8 @@ module HandleParanoiaDestroyedInBelongsToAssociation
case options[:dependent] case options[:dependent]
when :destroy when :destroy
target.destroy target.destroy
if defined? target.deleted? if target.respond_to?(:paranoia_destroyed?)
raise ActiveRecord::Rollback unless target.deleted? raise ActiveRecord::Rollback unless target.paranoia_destroyed?
else else
raise ActiveRecord::Rollback unless target.destroyed? raise ActiveRecord::Rollback unless target.destroyed?
end end
...@@ -25,8 +25,8 @@ module HandleParanoiaDestroyedInHasOneAssociation ...@@ -25,8 +25,8 @@ module HandleParanoiaDestroyedInHasOneAssociation
when :destroy when :destroy
target.destroyed_by_association = reflection target.destroyed_by_association = reflection
target.destroy target.destroy
if defined? target.deleted? if target.respond_to?(:paranoia_destroyed?)
throw(:abort) unless target.deleted? throw(:abort) unless target.paranoia_destroyed?
else else
throw(:abort) unless target.destroyed? throw(:abort) unless target.destroyed?
end 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