lib/iron_bank/action.rb in iron_bank-5.1.1 vs lib/iron_bank/action.rb in iron_bank-5.2.0
- old
+ new
@@ -38,12 +38,14 @@
response_object.fetch(:success, true)
end
def response_object
@response_object ||= begin
- return {} unless body.is_a?(Array)
-
- ::IronBank::Object.new(body.first).deep_underscore
+ if body.is_a?(Array)
+ ::IronBank::Object.new(body.first).deep_underscore
+ else
+ {}
+ end
end
end
def errors
{ errors: response_object.fetch(:errors, []) }