DmitryTsepelev / store_model

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

Add convenience methods to instantiate model from type #192

Closed bengladwell closed 2 weeks ago

bengladwell commented 2 weeks ago

Closes #191

Adds convenience methods StoreModel::Model.from_value and StoreModel::Model.from_values to instantiate StoreModel::Model classes from a type, rather than from the class itself, thus getting type behaviors like unknown attribute handling.

DmitryTsepelev commented 2 weeks ago

Hey @bengladwell! Sounds good, before I merge it in, could you please add some docs on how folks are expected to use it? 🙂

bengladwell commented 2 weeks ago

@DmitryTsepelev - I added docs. Let me know if you would like to see this stuff documented differently. Thanks.