Sha256: 1ffdfae64d9f166130b97414410a07fad2e74bf8df02fc0b6c5a5a3b8d252885

Contents?: true

Size: 690 Bytes

Versions: 12

Compression:

Stored size: 690 Bytes

Contents

# encoding: utf-8
module CouchRest
  module Model
    module Errors

      class CouchRestModelError < StandardError; end

      # Raised when a persisence method ending in ! fails validation. The message
      # will contain the full error messages from the +Document+ in question.
      #
      # Example:
      #
      # <tt>Validations.new(person.errors)</tt>
      class Validations < CouchRestModelError
        attr_reader :document
        def initialize(document)
          @document = document
          super("Validation Failed: #{@document.errors.full_messages.join(", ")}")
        end
      end
    end

    class DocumentNotFound < Errors::CouchRestModelError; end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
couchrest_model-2.0.4 lib/couchrest/model/errors.rb
couchrest_model-2.0.3 lib/couchrest/model/errors.rb
couchrest_model-2.0.1 lib/couchrest/model/errors.rb
couchrest_model-2.0.0 lib/couchrest/model/errors.rb
couchrest_model-2.0.0.beta2 lib/couchrest/model/errors.rb
couchrest_model-2.0.0.beta lib/couchrest/model/errors.rb
couchrest_model-1.2.0.beta lib/couchrest/model/errors.rb
openlogic-couchrest_model-1.0.0 lib/couchrest/model/errors.rb
couchrest_model-1.1.2 lib/couchrest/model/errors.rb
couchrest_model-1.1.1 lib/couchrest/model/errors.rb
couchrest_model-1.1.0 lib/couchrest/model/errors.rb
couchrest_model-1.1.0.rc1 lib/couchrest/model/errors.rb