Sha256: 10af9d1a51813f8a97344ccd7f42cbcb29543d686799ff45bce48c22045b10a6

Contents?: true

Size: 682 Bytes

Versions: 7

Compression:

Stored size: 682 Bytes

Contents

module Mongoa
  module MongoMapper
    module Matchers
      class ValidateUniquenessOfMatcher < ValidateBase
        def initialize(attribute)
          super(attribute)
        end

        def matches?(subject)
          super(subject)
        end

        def description
          "require #{@attribute} to be unique"
        end

        def failure_message
          "Expected #{@attribute} to be unique but was not"
        end

        def negative_failure_message
          "Expected #{@attribute} not to be unique but was"
        end
        
        private 
        
        def validation_type
          "ValidatesUniquenessOf"
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mongoa-0.2.3 lib/mongoa/mongo_mapper/validations/validate_uniqueness_of.rb
mongoa-0.2.2 lib/mongoa/mongo_mapper/validations/validate_uniqueness_of.rb
mongoa-0.2.1 lib/mongoa/mongo_mapper/validations/validate_uniqueness_of.rb
mongoa-0.1.17 lib/mongoa/mongo_mapper/validations/validate_uniqueness_of.rb
mongoa-0.1.16 lib/mongoa/mongo_mapper/validations/validate_uniqueness_of.rb
mongoa-0.1.15 lib/mongoa/mongo_mapper/validations/validate_uniqueness_of.rb
mongoa-0.1.14 lib/mongoa/mongo_mapper/validations/validate_uniqueness_of.rb