The ModelAttribute gem - an alternative to Virtus
ModelAttribute provides a simple alternative to Virtus for adding attributes to models. Its key advantage over Virtus is built-in dirty tracking, making ModelAttribute perfect for models that are backed by a web service.
Other features:
- Type casting and checking.
- Default values.
- Handles integers, booleans, strings and times - a set of types that are very easy to persist to and parse from JSON.
- Efficient serialization of attributes to JSON.
- Mass assignment - handy for initializers.
Post a comment