Module: ActiveResource::Validations

Defined in:
lib/esp/extensions/active_resource/validations.rb

Instance Method Summary collapse

Instance Method Details

#load_remote_errors(remote_errors, save_cache = false) ⇒ Object

Loads the set of remote errors into the object’s Errors based on the content-type of the error-block received.



5
6
7
8
9
10
11
# File 'lib/esp/extensions/active_resource/validations.rb', line 5

def load_remote_errors(remote_errors, save_cache = false) #:nodoc:
  if self.class.format == ActiveResource::Formats::JsonAPIFormat
    errors.from_json_api(remote_errors.response.body, save_cache)
  elsif self.class.format == ActiveResource::Formats[:json]
    super
  end
end