Sha256: dd5a47599c4877356c0280298905ecff8ccfcfb9cb2188f367c1918ec8200571
Contents?: true
Size: 678 Bytes
Versions: 7
Compression:
Stored size: 678 Bytes
Contents
module ActiveResource module Validations # Validate a resource and save (POST) it to the remote web service. def save_with_validation save_without_validation true rescue ResourceInvalid => error case error.response['Content-Type'] when /xml/ #PATCH errors.from_xml(error.response.body) when /json/ #PATCH errors.from_json(error.response.body) end false end end class Errors # Patched cause we dont need no attribute name magic .. and its just simpler def from_array(messages) clear messages.each do |msg| add msg[0], msg[1] end end end #Errors end
Version data entries
7 entries across 7 versions & 1 rubygems