Class: Mongoa::MongoMapper::Matchers::ValidatePresenceOfMatcher
- Inherits:
-
ValidateBase
- Object
- ValidateBase
- Mongoa::MongoMapper::Matchers::ValidatePresenceOfMatcher
show all
- Defined in:
- lib/mongoa/mongo_mapper/validations/validate_presence_of.rb
Instance Attribute Summary
Attributes inherited from ValidateBase
#attribute
Instance Method Summary
collapse
#initialize, #matches?
Instance Method Details
#description ⇒ Object
5
6
7
|
# File 'lib/mongoa/mongo_mapper/validations/validate_presence_of.rb', line 5
def description
"require #{@attribute} to be set"
end
|
#failure_message ⇒ Object
9
10
11
|
# File 'lib/mongoa/mongo_mapper/validations/validate_presence_of.rb', line 9
def failure_message
"Expected #{@attribute} to be a required field (validates_presence_of or :required => true) but was not"
end
|
#negative_failure_message ⇒ Object
13
14
15
|
# File 'lib/mongoa/mongo_mapper/validations/validate_presence_of.rb', line 13
def negative_failure_message
"Expected #{@attribute} to not be a required field (validates_presence_of or :required => true), but it was"
end
|