Sha256: 119248ea55dc0c492c6e156b7515afc32fc99cc280f197cb964df4963e35c871
Contents?: true
Size: 848 Bytes
Versions: 36
Compression:
Stored size: 848 Bytes
Contents
module MongoModel class DocumentNotFound < StandardError; end class DocumentNotSaved < StandardError; end # Raised by <tt>save!</tt> and <tt>create!</tt> when the document is invalid. Use the # +document+ method to retrieve the document which did not validate. # begin # complex_operation_that_calls_save!_internally # rescue MongoModel::DocumentInvalid => invalid # puts invalid.document.errors # end class DocumentInvalid < DocumentNotSaved attr_reader :document def initialize(document) @document = document errors = @document.errors.full_messages.join(I18n.t('support.array.words_connector', :default => ', ')) super(I18n.t('mongomodel.errors.messages.document_invalid', :errors => errors)) end end class AssociationTypeMismatch < StandardError; end end
Version data entries
36 entries across 36 versions & 1 rubygems