DmitryTsepelev / store_model

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

Remove enum mapping instance method #142

Closed jas14 closed 1 year ago

jas14 commented 1 year ago

As @BoberMod pointed out in https://github.com/DmitryTsepelev/store_model/pull/135#discussion_r1124487764, that PR introduces a regression in cases where the name of an enum is already pluralized; specifically, the instance method to access the enum value is superseded with the instance method to access the enum mapping.

Since there's already a class method to access the enum mapping, and the precedent (in ActiveRecord) doesn't set an instance method to access the enum mapping anyway, this PR removes the instance method to access the enum mapping.

I hope the diff in docs/enums.md and the specs sufficiently illustrate the practical difference!

jas14 commented 1 year ago

Thanks @DmitryTsepelev ! 😃