From efc726d055ac75e3684b7272561e7f9d95735738 Mon Sep 17 00:00:00 2001 From: Brian Rose & Mike Barinek Date: Wed, 28 Jul 2010 05:18:58 +0800 Subject: [PATCH] revert_to now writes attributes via hash-style assignment instead of directly in order to prevent running a custom setter on a value twice. --- lib/acts_as_versioned.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acts_as_versioned.rb b/lib/acts_as_versioned.rb index 135c079..6356dd2 100644 --- a/lib/acts_as_versioned.rb +++ b/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)