lib/ballast/service.rb in ballast-2.2.3 vs lib/ballast/service.rb in ballast-2.2.4

- old
+ new

@@ -63,17 +63,17 @@ # # @param transport [Object|NilClass] The transport to use for sending. Must respond to `render`, `params`, `request.format` and `performed?`. # @return [AjaxResponse] The AJAX response, which will include only the first error. def as_ajax_response(transport = nil) status, error_message = - if successful? - [:ok, nil] - elsif error.is_a?(Hash) - [error[:status], error[:error]] - else - [:unknown, error] - end + if successful? + [:ok, nil] + elsif error.is_a?(Hash) + [error[:status], error[:error]] + else + [:unknown, error] + end AjaxResponse.new(status: status, data: data, error: error_message, transport: transport) end end @@ -96,10 +96,10 @@ end # Marks the failure of the operation. # # @param details [Object] The error(s) occurred. - def self.fail!(details, on_validation: false) + def self.fail!(details) raise(Errors::Failure, details) end # Marks the failure of the validation of the operation. #