Why can't we have more than one enum

24 views
Skip to first unread message

Karthikeyan A K

unread,
Jan 4, 2016, 5:39:30 AM1/4/16
to rubyonra...@googlegroups.com
Why its not possible to have more than one enum in Rails model? Though it throws out no error or warning, discovering that its not possible is quiet annoying.

Cold this be added as a feature request for future Rails version?

If two enums have a same keyword say like

enum enum1:  [:a , :b, :c]
enum enum2: [:d, :b, :f]

Then Rails can throw out an exception that :b is replicated. I did checkout _prefix and _suffix, but that that doesn't seems to work for me and doesn't look nice.

--
Karthikeyan A K
https://goo.gl/NYcfo3 - My Ruby Book
Reply all
Reply to author
Forward
0 new messages