Sha256: 72dbd2a1284bbcd9d31093d6acf5fd500c14557cb3efd676d5e5e902b17cbd75

Contents?: true

Size: 1.28 KB

Versions: 22

Compression:

Stored size: 1.28 KB

Contents

Stubs out a new model. Pass the model name, either CamelCased or
under_scored, and an optional list of attribute pairs as arguments.

Attribute pairs are field:type arguments specifying the
model's attributes. Timestamps are added by default, so you don't have to
specify them by hand as 'created_at:datetime updated_at:datetime'.

You don't have to think up every attribute up front, but it helps to
sketch out a few so you can start working with the model immediately.


Available field types:

Are the same as ActiveRecord, to wit:
     integer
     primary_key
     decimal
     float
     boolean
     binary
     string
     text
     date
     time
     datetime
     references

Example:

 When executed inside a project called "Blog":

 `lanes generate model comments user:references subject:string{60} body:text`

 Lanes will create:

         Migration:     db/migrate/XXX_create_comments.rb
         Model:         lib/blog/comment.rb
         Model Spec:    spec/comment_spec.rb
         Fixtures:      spec/fixtures/comments.yml
         Client Model:  client/data/Comment.coffee
         Client Spec:   spec/client/data/CommentSpec.coffee

  The Ruby model will contain a `belongs_to` association to the User model,
  and the Javascript model definition will also have an association defined.

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
lanes-0.8.3 lib/lanes/command/generate_model.usage
lanes-0.8.2 lib/lanes/command/generate_model.usage
lanes-0.8.1 lib/lanes/command/generate_model.usage
lanes-0.8.0 lib/lanes/command/generate_model.usage
lanes-0.7.0 lib/lanes/command/generate_model.usage
lanes-0.6.1 lib/lanes/command/generate_model.usage
lanes-0.6.0 lib/lanes/command/generate_model.usage
lanes-0.5.6 lib/lanes/command/generate_model.usage
lanes-0.5.5 lib/lanes/command/generate_model.usage
lanes-0.5.0 lib/lanes/command/generate_model.usage
lanes-0.4.0 lib/lanes/command/generate_model.usage
lanes-0.3.0 lib/lanes/command/generate_model.usage
lanes-0.1.9.5 lib/lanes/command/generate_model.usage
lanes-0.1.9 lib/lanes/command/generate_model.usage
lanes-0.1.8 lib/lanes/command/generate_model.usage
lanes-0.1.7 lib/lanes/command/generate_model.usage
lanes-0.1.6 lib/lanes/command/generate_model.usage
lanes-0.1.5 lib/lanes/command/generate_model.usage
lanes-0.1.2 lib/lanes/command/generate_model.usage
lanes-0.1.0 lib/lanes/command/generate_model.usage