2
What is the best way to create a model q has a field that is an integer Enum ? ex:Rails g model status ( do not know how to inform that it is an Enum nor the data type)
2
What is the best way to create a model q has a field that is an integer Enum ? ex:Rails g model status ( do not know how to inform that it is an Enum nor the data type)
1
Create as a whole, and then configure the model:
Rails g model person status:integer
http://api.rubyonrails.org/v4.1/classes/ActiveRecord/Enum.html
0
You can use a Boolean for values true
or false
.
status:boolean
Browser other questions tagged ruby-on-rails ruby
You are not signed in. Login or sign up in order to post.