Exception: Shoulda::Matchers::ActiveModel::CouldNotSetPasswordError

Inherits:
Error
  • Object
show all
Defined in:
lib/shoulda/matchers/active_model/errors.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Error

#initialize, #inspect

Constructor Details

This class inherits a constructor from Shoulda::Matchers::Error

Instance Attribute Details

#modelObject

Returns the value of attribute model.



30
31
32
# File 'lib/shoulda/matchers/active_model/errors.rb', line 30

def model
  @model
end

Class Method Details

.create(model) ⇒ Object



26
27
28
# File 'lib/shoulda/matchers/active_model/errors.rb', line 26

def self.create(model)
  super(model: model)
end

Instance Method Details

#messageObject



32
33
34
35
36
37
38
# File 'lib/shoulda/matchers/active_model/errors.rb', line 32

def message
  <<-EOT.strip
The validation failed because your #{model_name} model declares `has_secure_password`, and
`validate_presence_of` was called on a #{record_name} which has `password` already set to a value.
Please use a #{record_name} with an empty `password` instead.
  EOT
end