Created
October 11, 2008 07:43
-
-
Save dbussink/16221 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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