Sha256: 31a443d3e8db77760721e77259c6395da4f224a907cc27ec17403c1199627436
Contents?: true
Size: 679 Bytes
Versions: 38
Compression:
Stored size: 679 Bytes
Contents
# For json and xml, will render the result of an active_interaction operation if no errors where present. # Otherwise renders the interaction module Roqua module Responders module ActiveInteractionAwareResponder def to_format if resource.is_a?(ActiveInteraction::Base) if resource.errors.empty? @resource = resource.result @resources[-1] = resource end end super end def json_resource_errors if !resource.is_a?(ActiveInteraction::Base) || resource.errors.empty? super else {:errors => resource.errors.as_json} end end end end end
Version data entries
38 entries across 38 versions & 1 rubygems