RubyFlow The Ruby and Rails community linklog

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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in