Skip to content

Commit

Permalink
Reset paranoia_column before updating it. Fixes rubysherpas#153
Browse files Browse the repository at this point in the history
  • Loading branch information
wioux committed Aug 25, 2014
1 parent b34b890 commit d60fa30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/paranoia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def restore!(opts = {})
# This only happened on Rails versions earlier than 4.1.
noop_if_frozen = ActiveRecord.version < Gem::Version.new("4.1")
if (noop_if_frozen && !@attributes.frozen?) || !noop_if_frozen
write_attribute paranoia_column, paranoia_sentinel_value
update_column paranoia_column, paranoia_sentinel_value
end
restore_associated_records if opts[:recursive]
Expand Down

0 comments on commit d60fa30

Please sign in to comment.