Syntax to specify limit while generating a model
You need to give the size in the curly braces, which will get transformed into limits
rails generate model MyModel some_id:integer{20} some_name:string{255}
some_text:text some_int:integer{1} some_deci:decimal{10,2}
You can also have other data types such as boolean, date, time, datetime, float, binary etc..
Options are something like 'do you also need to run migration' or not.
You can provide the limit with braces:
rails g model Session session_id:string{40} user_agent:string{200}
In rails 5 I had to use rails g model User name:"string{16}"