aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource
diff options
context:
space:
mode:
authorJosef Reidinger <jreidinger@suse.cz>2010-07-27 09:55:33 +0200
committerJosé Valim <jose.valim@gmail.com>2010-08-02 17:06:09 +0200
commit59693c4c49cce5e4cf53eb54e42e3da07a98467e (patch)
tree0835960f47466fbc3b7b88fa16ddbf81b4ba8542 /activeresource/lib/active_resource
parente1344bf5048934b0f231974c3597dfbc1c76154f (diff)
downloadrails-59693c4c49cce5e4cf53eb54e42e3da07a98467e.tar.gz
rails-59693c4c49cce5e4cf53eb54e42e3da07a98467e.tar.bz2
rails-59693c4c49cce5e4cf53eb54e42e3da07a98467e.zip
fix loading of different elements in array then int and string [#5036 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r--activeresource/lib/active_resource/base.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index 72ad2f5872..62420725ad 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -1222,10 +1222,10 @@ module ActiveResource
when Array
resource = find_or_create_resource_for_collection(key)
value.map do |attrs|
- if attrs.is_a?(String) || attrs.is_a?(Numeric)
- attrs.duplicable? ? attrs.dup : attrs
- else
+ if attrs.is_a?(Hash)
resource.new(attrs)
+ else
+ attrs.duplicable? ? attrs.dup : attrs
end
end
when Hash