aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails_generator/generators/components/model/USAGE
blob: 57156ea535c03cdd518b37363fba5468c3bf05ba (plain) (tree)
1
2
3
4
5
6
7
8
9






                                                                              

                                                                                







                                              
                                                  
 
Description:
    The model generator creates stubs for a new model.

    The generator takes a model name as its argument.  The model name may be
    given in CamelCase or under_score and should not be suffixed with 'Model'.

    The generator creates a model class in app/models, a test suite in
    test/unit, test fixtures in test/fixtures/singular_name.yml, and a migration
    in db/migrate.

Example:
    ./script/generate model Account

    This will create an Account model:
        Model:      app/models/account.rb
        Test:       test/unit/account_test.rb
        Fixtures:   test/fixtures/accounts.yml
        Migration:  db/migrate/XXX_add_accounts.rb