Usage:
rails generate model NAME [field:type field:type] [options]
Ok. I don’t want a migration or a fixture. The help text doesn’t tell
me how to do that (it only tells me the default is to create those
things), but some Googling seems to suggest I can prefix --fixture and
–migration with ‘no-’. I only want to pretend to run the generator,
and the help text says I should use -p. So here goes, exactly as the
usage string says:
%> rails -v
Rails 3.0.1
%> rails g model foo -p --no-migration --no-fixture
invoke active_record
identical app/models/foo.rb
invoke test_unit
identical test/unit/foo_test.rb
/home/scott/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/minitest/unit.rb:
566:in block in process_args': invalid option: -p (OptionParser::InvalidOption) from /home/scott/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/ minitest/unit.rb:545:in
new’
from /home/scott/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/
minitest/unit.rb:545:in process_args' from /home/scott/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/ minitest/unit.rb:576:in
run’
from /home/scott/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/
minitest/unit.rb:492:in `block in autorun’
It blows up on the -p option. It doesn’t even get to my undocumented –
no- options. What’s going on?