在2.6.2版本下,匹配器在测试时是否发出以下警告
ensure_inclusion_of(:available).in_array([true, false])
:
Warning from shoulda-matchers:
You are using `ensure_inclusion_of` to assert that a boolean column allows
boolean values and disallows non-boolean ones. Assuming you are using
`validates_format_of` in your model, be aware that it is not possible to fully
test this, and in fact the validation is superfluous, as boolean columns will
automatically convert non-boolean values to boolean ones. Hence, you should
consider removing this test and the corresponding validation.
似乎您应该删除测试和验证。