thoughtbot/shoulda-matchers · error · CouldNotDetermineValueOutsideOfArray

CouldNotDetermineValueOutsideOfArray

Error message

CouldNotDetermineValueOutsideOfArray

What it means

Error "CouldNotDetermineValueOutsideOfArray" thrown in thoughtbot/shoulda-matchers.

Source

Thrown at lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:565

              return true
            when [nil]
              if attribute_column.null
                Shoulda::Matchers.warn boolean_allows_nil_message
                return true
              else
                raise NonNullableBooleanError.create(@attribute)
              end
            end
          end

          values_outside_of_array.all? do |value|
            disallows_value_of(value, @low_message)
          end
        end

        def values_outside_of_array
          if !(@array & outside_values).empty?
            raise CouldNotDetermineValueOutsideOfArray
          else
            outside_values
          end
        end

        def outside_values
          case attribute_type
          when :boolean
            boolean_outside_values
          when :integer
            [ARBITRARY_OUTSIDE_INTEGER]
          when :decimal
            [ARBITRARY_OUTSIDE_DECIMAL]
          when :date
            [ARBITRARY_OUTSIDE_DATE]
          when :datetime
            [ARBITRARY_OUTSIDE_DATETIME]
          when :time

View on GitHub (pinned to 79cdfbc326)

When it happens

Trigger: Thrown at lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb:565 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thoughtbot/shoulda-matchers@79cdfbc326 (2026-08-23). Data as JSON: /api/errors/6895f623b823f1d3. Report an issue: GitHub.