switching to strings in enum limits#12
Conversation
|
It's king of really serious change, as the idea of gem is in using symbols, not strings (it's easier to find usages of symbols in project, for example, strings are not immutable, and so on). If you need to use strings like "!" you can also use them as symbols like :"!" or :"-", this is valid ruby syntax. |
|
I've got a legacy database containing these enum columns with "!" values. |
|
It's not necessary to do it always, but if string value contains special symbols (regexp is something like /^\w/) it's better to do it, I deem. |
I switched the type of the enums limit array contents from symbols to strings, as enums with values like "!" resulted in invalid symbols ( :! )
enums look now like this:
t.enum "action", :limit => ["-", "s", "i", "c", "!"]