Commit d60fa303 by Peter Woo

Reset paranoia_column before updating it. Fixes #153

parent b34b8904
...@@ -91,6 +91,7 @@ module Paranoia ...@@ -91,6 +91,7 @@ module Paranoia
# This only happened on Rails versions earlier than 4.1. # This only happened on Rails versions earlier than 4.1.
noop_if_frozen = ActiveRecord.version < Gem::Version.new("4.1") noop_if_frozen = ActiveRecord.version < Gem::Version.new("4.1")
if (noop_if_frozen && !@attributes.frozen?) || !noop_if_frozen if (noop_if_frozen && !@attributes.frozen?) || !noop_if_frozen
write_attribute paranoia_column, paranoia_sentinel_value
update_column paranoia_column, paranoia_sentinel_value update_column paranoia_column, paranoia_sentinel_value
end end
restore_associated_records if opts[:recursive] restore_associated_records if opts[:recursive]
......
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