A boolean field was nil after retrieving it from the DB where it should have a value. Fixed so that the value can be retrieved in this PR. If you comment out this change, you can see that it is nil in the added test case.
In the test case 'supports boolean column as enumerized field' in file test/activerecord_test.rb, the @attr in Enumerize::ActiveRecordSupport::Type#cast looked like this.
In the test case, when Enumerize::ActiveRecordSupport::Type#cast was called, the @attr looked like this.
A boolean field was nil after retrieving it from the DB where it should have a value. Fixed so that the value can be retrieved in this PR. If you comment out this change, you can see that it is
nil
in the added test case.In the test case
'supports boolean column as enumerized field'
in file test/activerecord_test.rb, the@attr
inEnumerize::ActiveRecordSupport::Type#cast
looked like this.In the test case, when
Enumerize::ActiveRecordSupport::Type#cast
was called, the@attr
looked like this.The actual
value
is'0'
or'1'
at the time it is retrieved from the DB. The result wasnil
because the key of@attr
did not contain them.