Sha256: 1a72afb1714f1e4d9fd37f49be20d5ae7eb374c5e12804233840388b8c558c04
Contents?: true
Size: 558 Bytes
Versions: 37
Compression:
Stored size: 558 Bytes
Contents
module Rao module Api module ResourcesController::SerializationConcern extend ActiveSupport::Concern private def serialize_collection(collection) collection.collect do |resource| serialize_resource(resource) end end def serialize_resource(resource) json = resource.as_json json[:errors] = serialize_errors(resource.errors) if resource.errors.any? json end def serialize_errors(errors) errors.as_json(full_messages: true) end end end end
Version data entries
37 entries across 37 versions & 1 rubygems