{"record":{"id":"a376781a185c2ded","repo":"thoughtbot/shoulda-matchers","slug":"you-have-specified-that-your-model-s-attribute","errorCode":null,"errorMessage":"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.","messagePattern":"You have specified that your model's #(.+?) should ensure inclusion of nil\\.\nHowever, #(.+?) is a boolean column which does not allow null values\\.\nHence, this test will fail and there is no way to make it pass\\.","errorType":"exception","errorClass":"NonNullableBooleanError","httpStatus":null,"severity":"error","filePath":"lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb","lineNumber":532,"sourceCode":"\n        def disallows_any_values_in_array?\n          @array.any? do |value|\n            disallows_value_of(value, @low_message)\n          end\n        end\n\n        def allows_any_value_outside_of_array?\n          if attribute_type == :boolean\n            case @array\n            when [false, true], [true, false]\n              Shoulda::Matchers.warn boolean_allows_boolean_message\n              return true\n            when [nil]\n              if attribute_column.null\n                Shoulda::Matchers.warn boolean_allows_nil_message\n                return true\n              else\n                raise NonNullableBooleanError.create(@attribute)\n              end\n            end\n          end\n\n          values_outside_of_array.any? do |value|\n            allows_value_of(value, @low_message)\n          end\n        end\n\n        def disallows_all_values_outside_of_array?\n          if attribute_type == :boolean\n            case @array\n            when [false, true], [true, false]\n              Shoulda::Matchers.warn boolean_allows_boolean_message\n              return true\n            when [nil]\n              if attribute_column.null\n                Shoulda::Matchers.warn boolean_allows_nil_message","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/thoughtbot/shoulda-matchers/blob/79cdfbc326e97c9b43991b644434ca53c1f62c4c/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb#L514-L550","documentation":"Error \"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.\" thrown in thoughtbot/shoulda-matchers.","triggerScenarios":"Thrown at lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:532 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79cdfbc326e97c9b43991b644434ca53c1f62c4c","analyzedAt":"2026-08-23T09:43:24.200Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}