DmitryTsepelev / store_model

Work with JSON-backed attributes as ActiveRecord-ish models
MIT License
1.04k stars 85 forks source link

Fixed issue for empty nested array #173

Closed manuelvanrijn closed 3 months ago

manuelvanrijn commented 3 months ago

After the introduction of #171, I found an issue with my nested model containing an array with no elements in it (due to default: []).

This PR first checks if the array is empty, before validating if all values are StoreModel::Model objects.

phinze commented 3 months ago

Hi there, it looks like this did not land before the upgrade was released, so upgrading to 3.0.0 yields a lot of NoMethodError: undefined method 'serialize_unknown_attributes?' for nil:NilClass errors.

Do you think you could merge this and cut a bugfix release?