simple_enum
simple_enum copied to clipboard
Simple enum-like field support for ActiveModel (including validations and i18n)
Ruby 3.0 separates keyword arguments from positional arguments. https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ This PR makes `simple_enum` compatible with the new behavior. As `**` isn't supported in Ruby 1.9, this PR falls back to...
There are often times when it doesn't make any sense to add scopes to an `enum` attribute. i.e. You would never query the parent Model for certain values of that...
Keep same api but make it compatible with rails 5.x and mongoid 6.x - Basically I've just removed alias_method_chain - Remove some deprecation warnings
I've had the same misunderstanding occur with different developers of my team and I believe it might be the case for a lot of people from the Ruby world: the...
I just want to double check, but in the 1.x version it was advised to name the enum collection in the plural form in the i18n yaml file eg. ```...
I have been talking with @lwe about the future of this gem, I am sure we all agree he has done a fantastic job maintaining and developing this library over...
Hi, Sorry if I've missed it but I haven't found any info for easily querying using "or" conditions. Let say we have: as_enum :status, { active: 0, pending: 1, declined:...
Let's say we have a simple _Mongoid_ model: ``` ruby class Article include SimpleEnum::Mongoid VALID_TYPES = { blog: 0, vlog: 1, xlog: 2 } # ... as_enum :type, VALID_TYPES, source:...
- [x] Enums should be symbols, see #100 - [x] #fetch method for SE::Enum, see #96 - [ ] Helper methods for queries, see #95 Any other wishes? Also feel...
Have you ever tried putting together SimpleEnum with Elasticsearch ? Any tips on how to make it work ?