Sha256: e11dba574b27db6b771e0c2aef39c495b3281694a5355faf723c624aed9b46f8
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
### v0.1.0 * Added Rails scope helpers for searching on enum values. For a given model `User` with an enum attribute of `role` with keys `admin`, `editor`, `author`, and `user`, the following scopes will be added: * `User.role_admin` * `User.role_editor` * `User.role_author` * `User.role_user` * Added `to_h` and `to_json` methods to an `Enum` like `User::Role` to give the hash and json string representations of the enum, respectively. ### v0.0.6 * Added example usage of extending `RailsAttrEnum` and calling `attr_enum` in `User` model in test Rails app. * Fixed a bug that crashed the Rails environment when a model without an existing table used `RailsAttrEnum`. An example of this happening would be when someone tried to run `rake db:schema:load`. * Fixed a bug in `clear_user` in the spec_helper.rb file with calling the private `remove_instance_variable` method on the test model `User`. * Added `default_user_roles` to spec_helper.rb file, so a default usage of extending `RailsAttrEnum` and calling `attr_enum` could be established. This allows other future specs that depend on that default usage to not be messed up by the user_spec.rb file which alters `RailsAttrEnum` usage in `User` for different tests. ### v0.0.5 * Fix a bug with the 'to_json' and 'as_json' methods for a model that has an enum attribute set up.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_attr_enum-0.1.0 | CHANGELOG.md |