Sha256: b16d3aa61cfad955b2dd0bdc9e247132c50f8026c0a71f10fb20b815dc34cd19

Contents?: true

Size: 1.14 KB

Versions: 39

Compression:

Stored size: 1.14 KB

Contents

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'.

    As additional parameters, the generator will take attribute pairs described by name and type. These attributes will
    be used to prepopulate the migration to create the table for the model and give you a set of predefined fixture.    
    You don't have to think up all attributes up front, but it's a good idea of adding just the baseline of what's 
    needed to start really working with the resource.

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

Examples:
    ./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

    ./script/generate model post title:string created_on:date body:text published:boolean
    
        Creates post model with predefined attributes.

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
hobo-1.1.0 rails_generators/hobo_model/USAGE
hobo-1.0.3 rails_generators/hobo_model/USAGE
hobo-1.1.0.pre4 rails_generators/hobo_model/USAGE
hobo-1.1.0.pre3 rails_generators/hobo_model/USAGE
hobo-1.1.0.pre2 rails_generators/hobo_model/USAGE
hobo-1.1.0.pre0 rails_generators/hobo_model/USAGE
hobo-1.0.2 rails_generators/hobo_model/USAGE
hobo-1.0.1 rails_generators/hobo_model/USAGE
hobo-1.0.0 rails_generators/hobo_model/USAGE
hobo-0.9.106 rails_generators/hobo_model/USAGE
hobo-0.9.105 rails_generators/hobo_model/USAGE
hobo-0.9.104 rails_generators/hobo_model/USAGE
hobo-0.9.103 rails_generators/hobo_model/USAGE
hobo-0.9.102 rails_generators/hobo_model/USAGE
hobo-0.9.101 rails_generators/hobo_model/USAGE
hobo-0.9.100 rails_generators/hobo_model/USAGE
hobo-0.9.0 rails_generators/hobo_model/USAGE
hobo-0.8.10 rails_generators/hobo_model/USAGE
hobo-0.8.9 rails_generators/hobo_model/USAGE
hobo-0.8.8 rails_generators/hobo_model/USAGE