Skip to content
Andrey Koleshko edited this page Sep 15, 2015 · 7 revisions
  • Why should I use enum method and there are no automatically generated methods for enum values?

Because it's hard to find generated methods in a Ruby project with a lot of code. Refactoring is doing very hard this way.

  • Why all values are strings but not, for example, integers?

Because they are order agnostic. Just use strings everywhere for enum fields: memory objects, a database table's fields and etc. Use indexes if you want to have deal with integers.

Clone this wiki locally