2

In the documentation for Active Record Migrations in Rails 4.2.x, the section 2.3 Passing Modifiers says:

Some commonly used type modifiers can be passed directly on the command line. They are enclosed by curly braces and follow the field type:

For instance, running:

$ bin/rails generate migration AddDetailsToProducts 'price:decimal{5,2}' supplier:references{polymorphic}

...

Have a look at the generators help output for further details.

However, running bundle exec rails generate migration --help in Rails 4.2.x (in my case 4.2.3) doesn't mention anything about passing type modifiers - I can't even see a single curly brace.

I can see some documentation at 3.5 Column Modifiers, but how do I get the documentation referred to as being from the "generators help output"?

Paulo Fidalgo
  • 21,709
  • 7
  • 99
  • 115
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338

1 Answers1

3

To get the inline help describing types modifiers you need to run

bundle exec rails generate model --help

Also, the help text is coming from here: https://github.com/randoum/rails/blob/master/railties/lib/rails/generators/rails/model/USAGE

Benjamin Bouchet
  • 12,971
  • 2
  • 41
  • 73