Exception: Shoulda::Matchers::ActiveModel::NonNullableBooleanError

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

#attributeObject

Returns the value of attribute attribute.



13
14
15
# File 'lib/shoulda/matchers/active_model/errors.rb', line 13

def attribute
  @attribute
end

Class Method Details

.create(attribute) ⇒ Object



9
10
11
# File 'lib/shoulda/matchers/active_model/errors.rb', line 9

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

Instance Method Details

#messageObject



15
16
17
18
19
20
21
# File 'lib/shoulda/matchers/active_model/errors.rb', line 15

def message
  "You have specified that your model's \#{attribute} should ensure inclusion of nil.\nHowever, \#{attribute} is a boolean column which does not allow null values.\nHence, this test will fail and there is no way to make it pass.\n  EOT\nend\n".strip