Cyril Duchon-Doris
Cyril Duchon-Doris
@drobny I was thinking about just leaving `u.gender = :male` but the problem is is is not safe. What would happen if you changed the enum list to remove :male...
That can actually become nasty ! ``` User.find_or_create_by(name: "Test user", gender: :male) ``` ... I was wondering why I had so many users in my test database :P (`as_enum: :gender`)
You're right. But maybe we could define an extra convenience method that preprocesses the inputs so as to replace "meaningful enums" by their "meaningless database representation" Something like that ```...
I vote for `expand_enums_in_hash` (unless better choice appears) `.enums_to_selector` makes it feel like we're going to use the hash for a DB query, which isn't necessarily the case ? (Haven't...
I believe ActiveRecord/Mongoid are already doing the transformations from `{gender: [0, 1]}` to `{:gender.in => [0,1]}`
Do we need the inverse operation ? ``` .enums_to_int / .int_to_enums .expand_enums .meaningless (enum to int) /.meaningful (int to enum) .as_int / .as_enum (name collision ?) ```
The user will search with the translated values of the enum, not the symbols, so we need to also pull the translations to feed them to ES. [something like that...
The whole point of enums is to be meaningful. I'd rather be able to set default values like this ``` ruby as_enum :status, [:ok, :maintenance_needed, :broken], default: :ok ``` ...rather...
- A) Yeah I guess you're right. I'm so glad I switched to Mongoid, I just can't stand migrations... - B) Cool - C) Is there going to be much...
Hey, I'm using latest shoryuken (v3) and it seems it is actually `--config-file` Usage: shoryuken start Options: -c, [--concurrency=N] # Processor threads to use -d, [--daemon], [--no-daemon] # Daemonize process...