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.
1140 1141 1142 |
# File 'lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb', line 1140 def @underlying_exception end |
Instance Method Details
#message ⇒ Object
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 |
# File 'lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb', line 1142 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 |