Commit fb9c903a by Daniel Lehmann

Fixed error regarding the way the deleted_flag is set.

parent c14aa4b6
......@@ -9,11 +9,7 @@ module Paranoia
def destroy
_run_destroy_callbacks
self[:deleted_at] ||= Time.now
# If the instance has already been persisted, then we need to re-save it to flag it as
# destroyed / deleted. We don't require validation in case it causes the updated to fail.
save(:validate => false) if persisted?
freeze
self.update_attribute(:deleted_at, Time.now) if !deleted? && persisted?
end
alias :delete :destroy
......
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