aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-03-30 06:17:29 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-03-30 06:17:29 +0000
commitfa6fcb45e200e19fdd9540ee7b60ce91524c4fe7 (patch)
tree60a64628e1d535da726977cc69d107cca00d507b
parent316906cbbb529839c2ffa3f37a010193f7722352 (diff)
downloadrails-fa6fcb45e200e19fdd9540ee7b60ce91524c4fe7.tar.gz
rails-fa6fcb45e200e19fdd9540ee7b60ce91524c4fe7.tar.bz2
rails-fa6fcb45e200e19fdd9540ee7b60ce91524c4fe7.zip
Don't shadow attrs var
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9145 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--activeresource/lib/active_resource/base.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index d854b9baed..cd53c5d771 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -629,7 +629,7 @@ module ActiveResource
#
def clone
# Clone all attributes except the pk and any nested ARes
- attrs = self.attributes.reject {|k,v| k == self.class.primary_key || v.is_a?(ActiveResource::Base)}.inject({}) do |attrs, (k, v)|
+ cloned = attributes.reject {|k,v| k == self.class.primary_key || v.is_a?(ActiveResource::Base)}.inject({}) do |attrs, (k, v)|
attrs[k] = v.clone
attrs
end
@@ -638,7 +638,7 @@ module ActiveResource
# the raw objects to be cloned so we bypass load by directly setting the attributes hash.
resource = self.class.new({})
resource.prefix_options = self.prefix_options
- resource.send :instance_variable_set, '@attributes', attrs
+ resource.send :instance_variable_set, '@attributes', cloned
resource
end