Sha256: f2a63e53aa54af6c934a3a8ec2f02c4d7096b733421fab6c57331dd4e3f53add
Contents?: true
Size: 336 Bytes
Versions: 20
Compression:
Stored size: 336 Bytes
Contents
require 'grape_entity' module Grape::App::Helpers::RespondWith class Errors < Grape::Entity expose :errors end # @param [ActiveRecord::Base] record validated record def respond_with(record, opts = {}) unless record.errors.empty? opts[:with] = Errors status 400 end present record, opts end end
Version data entries
20 entries across 20 versions & 1 rubygems