brainspec / enumerize

Enumerated attributes with I18n and ActiveRecord/Mongoid support
MIT License
1.73k stars 190 forks source link

fix: handle when ActiveRecord::Store has nil value in #reload #440

Closed 4ndypanda closed 8 months ago

4ndypanda commented 9 months ago

An ActiveRecord object could have a store column be nil so check that before trying to access an enumerized store attribute. This only occurs when using a store defined with .store_accessor and none of its enumerized store attributes have defaults.

nashby commented 9 months ago

@4ndypanda hey! Thanks for PR. Would you mind adding a test?

4ndypanda commented 9 months ago

@nashby I've updated this with a test.

nashby commented 8 months ago

Thank you!