What is the best way to create a model that has a field that is an integer enum?

2

What is the best way to create a model that has a field that is an integer enum? ex: rails g model status (I do not know how to report it is an enum nor the data type)

    
asked by anonymous 27.03.2016 / 16:03

2 answers

1

Create as an integer, and then configure the model:

rails g model person status: integer

link

    
28.03.2016 / 15:16
0

You can use a boolean for true or false values.

status:boolean

    
13.06.2016 / 23:08