Sha256: 049dbcf8cc1089f13aafa3ae7af5d2e8df9811757b6a60b7af0941f5e0405425

Contents?: true

Size: 1.28 KB

Versions: 9

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":

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

 Hippo 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

9 entries across 9 versions & 1 rubygems

Version Path
hippo-fw-0.9.9 lib/hippo/command/generate_model.usage
hippo-fw-0.9.8 lib/hippo/command/generate_model.usage
hippo-fw-0.9.7 lib/hippo/command/generate_model.usage
hippo-fw-0.9.6 lib/hippo/command/generate_model.usage
hippo-fw-0.9.5 lib/hippo/command/generate_model.usage
hippo-fw-0.9.4 lib/hippo/command/generate_model.usage
hippo-fw-0.9.3 lib/hippo/command/generate_model.usage
hippo-fw-0.9.2 lib/hippo/command/generate_model.usage
hippo-fw-0.9.1 lib/hippo/command/generate_model.usage