[Feature][ActiveRecord] enum values as symbols instead of strings

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Feature][ActiveRecord] enum values as symbols instead of strings

Jeffrey Manian
I love `ActiveRecord::Enum`, but I've always thought it should return symbols for its values instead of strings.

I went looking for discussion on this topic and couldn't find any. (I only found a recent discussion about using `StringInquirer`.) Does anyone know why the decision was made to use strings over symbols?

What do folks think about an option for `enum` to have it return symbols? Something like `symbolize_values`. Switching the default to symbols would break code, so I wouldn't suggest that.

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/fd8ea4d6-77e1-47f3-9eb4-937e9667a98f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.