Sha256: d5657e1e7ac71b68fe7c38d7ee3356d596c9102fadfa9cbbbb5c8fcd94a34434
Contents?: true
Size: 705 Bytes
Versions: 25
Compression:
Stored size: 705 Bytes
Contents
# frozen_string_literal: true module Mongoid module Errors # Raised when a persistence method ending in ! fails validation. The message # will contain the full error messages from the +Document+ in question. # # @example Create the error. # Validations.new(person.errors) class Validations < MongoidError attr_reader :document alias :record :document def initialize(document) @document = document super( compose_message( "validations", { document: document.class, errors: document.errors.full_messages.join(", ") } ) ) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems