Skip to content

Fix boolean casting for nil value

Jan Provaznik requested to merge rails5-boolean-cast into master

What does this MR do?

nil value is not included in ActiveModel::Type::Boolean::FALSE_VALUES which caused that in Rails 5 the boolean_accessor converted nil to true instead of false.

(https://stackoverflow.com/questions/16848052/value-to-boolean-deprecated-whats-a-good-replacement/25514105#25514105)

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #46925 (closed)

Merge request reports