diff options
author | Josef Reidinger <jreidinger@suse.cz> | 2010-07-27 09:55:33 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-08-02 17:06:09 +0200 |
commit | 59693c4c49cce5e4cf53eb54e42e3da07a98467e (patch) | |
tree | 0835960f47466fbc3b7b88fa16ddbf81b4ba8542 /activeresource/lib/active_resource | |
parent | e1344bf5048934b0f231974c3597dfbc1c76154f (diff) | |
download | rails-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.rb | 6 |
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 |