In conversations with a teammate, we were asking ourselves when Rails turns values given to a boolean field into true/false.
In Rails, saving a value from certain certain "FALSE_VALUES" (like false, 'FALSE', 0, '0'... https://github.com/rails/rails/blob/6-1-stable/activemodel/lib/active_model/type/boolean.rb) will be saved as false in the ActiveRecord record (if the column type is boolean, of course). All other values (I think) will be saves as true
Knowing this is great, but when are those values actually "turned" to either true or false?
Is this comparable to any callback (e.g. before_validation)? In our case especially, can we make sure it runs before validations are run?
If anyone even finds where this is stated within the rails code, it would be awesome pointing to that :)