A Ruby gem providing ActiveModel-like functionality for plain Ruby objects, including attributes, typecasting, mass assignment, and serialization.
ActiveAttr is a Ruby gem that extends plain Ruby objects with ActiveModel-like features such as attribute definitions, typecasting, mass assignment, and serialization. It solves the problem of needing ORM-like functionality without the complexity of ActiveRecord or full ActiveModel, making it ideal for lightweight model layers in non-Rails applications or as a supplement to existing models.
Ruby developers building plain Ruby objects that require structured attributes, type safety, and ActiveModel compatibility, especially in non-Rails projects or when avoiding full ORM overhead.
Developers choose ActiveAttr for its modularity and simplicity—it provides just the ActiveModel features needed without bloat, integrates seamlessly with Rails when desired, and offers a clean DSL for attribute management.
What ActiveModel left out
Allows selective inclusion of only needed modules like Attributes or MassAssignment, keeping models lightweight and focused, as shown in the README's composable examples.
TypecastedAttributes enable automatic conversion (e.g., string to integer) with a clean DSL, reducing boilerplate code for attribute handling.
MassAssignment supports Rails security features like strong parameters and protected attributes, ensuring safe bulk updates in both Rails and non-Rails apps.
Automatically configures with Rails logger and integrates with Rails tools, making it seamless for hybrid or non-Rails projects needing ActiveModel-like behavior.
BasicModel only meets minimum API requirements; advanced features like validations require additional ActiveModel includes, adding complexity.
Security features need manual inclusion of multiple modules (e.g., ForbiddenAttributesProtection), which can be error-prone and increase setup time.
Lacks built-in support for nested attributes or associations, forcing developers to implement these manually or rely on other gems.
[DISCONTINUED ] Attributes on Steroids for Plain Old Ruby Objects
Hashie is a collection of classes and mixins that make Ruby hashes more powerful.
Efficient, Immutable, Thread-Safe Collection classes for Ruby
Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. It is flexible, offers heuristic parsing, and additionally provides extensive support for IRIs and URI templates.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.