Ruboss Technology Corporation

The Flexible Rich Internet Applications Company

Working with yamlscaffold and multiscaffold scripts

You can now force an order on attributes specified in db/model.yml by prefixing a line with - (standard YAML). This will produce flex model, generated view component, migrations, etc based on the exact order you specify. You can mix and match ordered attribute models with unordered attribute models.

Here’s an example:

project:
 - name*: string
 - notes: text
 - completed: boolean
 - user_id: integer
 - has_many: [tasks]

location:
 name*: string
 notes: text
 user_id: integer
 has_many: [tasks] 

task:
 - name*: string
 - notes: text
 - completed: boolean
 - next_action: boolean
 - project_id: integer
 - location_id: integer
 - user_id: integer

This should produce ordered project and task artifacts and unordered location artifacts.

It is also possible to use a plain-text file to specify your models if you don’t like YAML for some reason. It should be located in db/model.txt. The format for it is quite simple, one model per line E.g.:

Project name:string notes:text completed:boolean user_id:integer has_many:tasks

If you are using plain text to store your models you should run ./script/multiscaffold instead of ./script/yamlscaffold

No Comments, Comment or Ping

Comments are closed.