-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flexible enum support to ActiveHash::Enum
- Implement `enum` method to support both array and hash-style definitions - Allow predicate methods generation for enum values - Support Rails-like enum syntax: `enum status: [:draft, :published, :archived]` - Support custom value mapping: `enum action: { like: 'LIKE', comment: 'COMMENT', ... }` - Add comprehensive tests for both enum definition styles This enhancement allows ActiveHash::Enum to handle enum definitions similar to Rails, improving compatibility and ease of use. It provides a more flexible way to define and use enums in ActiveHash models.
- Loading branch information
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters