Skip to content

Fix shoulda-matchers warning message about validate_inclusion_of for a boolean column #6670

@stefannibrasil

Description

@stefannibrasil

When running the tests -- see this example from CI, the following shoulda-matchers warning message is printed out:

Warning from shoulda-matchers:

You are using `validate_inclusion_of` to assert that a boolean column
allows boolean values and disallows non-boolean ones. Be aware that it
is not possible to fully test this, as boolean columns will
automatically convert non-boolean values to boolean ones. Hence, you
should consider removing this test.

It doesn't say which model needs to be have this assertion removed, but fetching the library's main should because this PR was merged recently: thoughtbot/shoulda-matchers#1692

Knowing which model is generating the warning will help fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions