Skip to content

Instantly share code, notes, and snippets.

@dbussink
Created October 11, 2008 07:43
Show Gist options
  • Save dbussink/16221 to your computer and use it in GitHub Desktop.
Save dbussink/16221 to your computer and use it in GitHub Desktop.
diff --git a/lib/dm-core/model.rb b/lib/dm-core/model.rb
index 79dab8a..46f63b0 100644
--- a/lib/dm-core/model.rb
+++ b/lib/dm-core/model.rb
@@ -309,8 +309,8 @@ module DataMapper
# TODO SPEC
def copy(source, destination, query = {})
repository(destination) do
- repository(source).read_many(query).each do |resource|
- self.create(resource)
+ repository(source).read_many(scoped_query(query)).each do |resource|
+ self.create(resource.attributes)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment