diff options
author | David Trasbo <me@dtrasbo.com> | 2010-06-26 19:16:17 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-26 19:23:10 +0200 |
commit | df083b482d3f22aebb5e48e608811a740037d2aa (patch) | |
tree | 88f9660353e6e21456e3a8b69fc56f884b76b5f3 /activeresource/lib | |
parent | 7eb5766bd1d7300e598fb81769da79ffbaa7b62a (diff) | |
download | rails-df083b482d3f22aebb5e48e608811a740037d2aa.tar.gz rails-df083b482d3f22aebb5e48e608811a740037d2aa.tar.bz2 rails-df083b482d3f22aebb5e48e608811a740037d2aa.zip |
Make sure ActiveResource::Errors#from_json doesn't pass nil to #from_array [#3650 state:commited]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/lib')
-rw-r--r-- | activeresource/lib/active_resource/validations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/validations.rb b/activeresource/lib/active_resource/validations.rb index a19e0d0ac9..026d81e44a 100644 --- a/activeresource/lib/active_resource/validations.rb +++ b/activeresource/lib/active_resource/validations.rb @@ -27,7 +27,7 @@ module ActiveResource # Grabs errors from a json response. def from_json(json, save_cache = false) - array = ActiveSupport::JSON.decode(json)['errors'] rescue [] + array = Array.wrap(ActiveSupport::JSON.decode(json)['errors']) rescue [] from_array array, save_cache end |