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

28 views
Skip to first unread message

Jeffrey Manian

unread,
May 19, 2019, 11:45:00 AM5/19/19
to Ruby on Rails: Core
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.
Reply all
Reply to author
Forward
0 new messages