Skip to content

Commit

Permalink
don't skip nil values when cloning models [Zachary Powell, Ian White]
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.techno-weenie.net/projects/plugins/acts_as_versioned@993 567b1171-46fb-0310-a4c9-b4bef9110e78
  • Loading branch information
technoweenie committed Mar 19, 2006
1 parent 1965e02 commit 1765f83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/acts_as_versioned.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def changed?(attr_name = nil)
# Clones a model. Used when saving a new version or reverting a model's version.
def clone_versioned_model(orig_model, new_model)
self.versioned_attributes.each do |key|
new_model.send("#{key}=", orig_model.attributes[key]) if orig_model.attribute_present?(key)
new_model.send("#{key}=", orig_model.attributes[key]) if orig_model.has_attribute?(key)
end

if orig_model.is_a?(self.class.versioned_class)
Expand Down

0 comments on commit 1765f83

Please sign in to comment.