Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

revert_to now writes attributes via hash-style assignment instead of …

…directly in order to prevent running a custom setter on a value twice.
  • Loading branch information...
commit efc726d055ac75e3684b7272561e7f9d95735738 1 parent 28ba061
Brian Rose & Mike Barinek authored technoweenie committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/acts_as_versioned.rb
View
2  lib/acts_as_versioned.rb
@@ -332,7 +332,7 @@ def altered?
# Clones a model. Used when saving a new version or reverting a model's version.
def clone_versioned_model(orig_model, new_model)
self.class.versioned_columns.each do |col|
- new_model.send("#{col.name}=", orig_model.send(col.name)) if orig_model.has_attribute?(col.name)
+ new_model[col.name] = orig_model.send(col.name) if orig_model.has_attribute?(col.name)
end
if orig_model.is_a?(self.class.versioned_class)
Please sign in to comment.
Something went wrong with that request. Please try again.