ecto_enum icon indicating copy to clipboard operation
ecto_enum copied to clipboard

Make it configurable to return either string or atom

Open gjaldon opened this issue 10 years ago • 4 comments

Right now, we just return atoms whenever we call user.status. We could accept an option in defenum so that user.status will return either string or atom instead.

gjaldon avatar Jul 08 '15 11:07 gjaldon

👍

Any updates on that?

kfigiela avatar Dec 30 '16 10:12 kfigiela

Our project uses both ecto_enum and exnumerator to get different types of value depending on what you defined.

you can have a try.

smartepsh avatar May 21 '18 06:05 smartepsh

Would be also helpful to get either the string or the integer as it is stored in the database. Especially in Ecto select.

acrolink avatar May 26 '18 11:05 acrolink

https://stackoverflow.com/questions/57726255/use-enum-ecto-types-as-strings-not-atoms-elixir

any help?

ijunaid8989 avatar Aug 30 '19 11:08 ijunaid8989