Exception: Shoulda::Matchers::ActiveRecord::ValidateUniquenessOfMatcher::ExistingRecordInvalid
- Inherits:
-
Error
- Object
- StandardError
- Error
- Shoulda::Matchers::ActiveRecord::ValidateUniquenessOfMatcher::ExistingRecordInvalid
- Includes:
- Shoulda::Matchers::ActiveModel::Helpers
- Defined in:
- lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb
Instance Attribute Summary collapse
-
#underlying_exception ⇒ Object
Returns the value of attribute underlying_exception.
Instance Method Summary collapse
Methods included from Shoulda::Matchers::ActiveModel::Helpers
#default_error_message, #format_validation_errors, #pretty_error_messages
Methods inherited from Error
Constructor Details
This class inherits a constructor from Shoulda::Matchers::Error
Instance Attribute Details
#underlying_exception ⇒ Object
Returns the value of attribute underlying_exception.
1128 1129 1130 |
# File 'lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb', line 1128 def @underlying_exception end |
Instance Method Details
#message ⇒ Object
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 |
# File 'lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb', line 1130 def <<-MESSAGE.strip validate_uniqueness_of works by matching a new record against an existing record. If there is no existing record, it will create one using the record you provide. While doing this, the following error was raised: #{Shoulda::Matchers::Util.indent(., 2)} The best way to fix this is to provide the matcher with a record where any required attributes are filled in with valid values beforehand. MESSAGE end |