Skip to content

Commit

Permalink
Just use associations instance methods and only test object id in reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Aug 29, 2010
1 parent a6c2aa7 commit bb5e804
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mongo_mapper/plugins/clone.rb
Expand Up @@ -7,7 +7,7 @@ def initialize_copy(other)
@_new = true
@_destroyed = false
default_id_value({})
self.class.associations.each do |name, association|
associations.each do |name, association|
instance_variable_set(association.ivar, nil)
end
self.attributes = other.attributes.clone.except(:_id).inject({}) do |hash, entry|
Expand Down
1 change: 0 additions & 1 deletion test/unit/test_clone.rb
Expand Up @@ -31,7 +31,6 @@ class CloneTest < Test::Unit::TestCase
end

should "clone many embedded documents" do
@doc.clone.widgets.should_not equal(@doc.widgets)
@doc.clone.widgets.object_id.should_not equal(@doc.widgets.object_id)
end

Expand Down

0 comments on commit bb5e804

Please sign in to comment.