Commit cc66d39d by lanrion

fixed if result is not Array in ResultHandler

parent 2b9b04a8
...@@ -39,6 +39,7 @@ module WeixinAuthorize ...@@ -39,6 +39,7 @@ module WeixinAuthorize
# result.result[:ok] #=> true # result.result[:ok] #=> true
# result.result['ok'] #=> true # result.result['ok'] #=> true
def package_result(result) def package_result(result)
return result if !result.is_a?(Hash)
if defined?(Rails) if defined?(Rails)
ActiveSupport::HashWithIndifferentAccess.new(result) ActiveSupport::HashWithIndifferentAccess.new(result)
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment