Rails Exporter Plugin
Configuration
http://rails.kirschekreativ.de/configuration.html

Copyright © 2013 Joerg Kirschstein

 

Configuration

Some paramters can be changed in the configuration function by editing the lua script and reinstall the modified file in Workbench. Some parameters can even be changed "on-the-fly" from "::Orders:" used in the comment fields of the schema or tables itself, directly in Workbench [check out this feature in the example schema file(s)].

Configurations in lua script: All parameters to be configured can be found in the function "SetConfiguration()". To have effect, after you changed code of the plugin you have to reinstall it in Workbench.

  • g_bDebug = true | false [enable/disable debug mode logtext output]
  • g_iMaxLengthForLimit= n [Length of Column Values to set an opional :Limit attribute (if " [Overwrite default APPDATA Path, so you can create files direcly into your rails app without timestamp subfolders]
  • g_bMigration = true | false [enable/disable migration files]
  • g_bSchema = true | false [enable/disable schema file]
  • g_bSeed = true | false [enable/disable seeds file]
  • g_bModel = true | false [enable/disable model files]
  • g_bAccessible = true | false [write 'attr_accessible' in models if this switch is on and seeds is off]
  • g_iSeedUnits = n [number of rows for seeds table data]
  • g_bForcePKeyID = true | false [replace primary keys differing from 'id' with rails default 'id']
  • g_bForceFKeyID = true | false [replace foreign keys differing from '_id' with rails default '_id']
  • g_bForceTimestamps = true | false [add timestamps [created_at/updated_at]]
  • g_bForceSeedException = true | false [use '!' in seeds with create!]
  • g_bUseComments = true | false [transform workbench schemas and table comments to files as ruby comments]
  • g_bUseCommentControl = true | false [allow Orders in comments (see below)]
  • g_bUseCompositePKeys = true | false [allow composite primary keys with :scope]
  • g_bUsePolymorphic = true | false [auto-detect polymorphic relations]
  • g_bUseBackups = true | false [use backups for all created rails files]
  • g_bUseAddIndex = true | false [add index for all foreign keys]
  • g_bUseModelID = true | false [set additional "_id" entry for foreign keys in models]
  • g_bUseTablenameInIndexname = true | false [add table name as prefix to index names]
  • g_strUseEncoding = "" | 'utf-8' etc. [add encoding to first line on every rails file]

Orders in comment fields
You can overwrite configuration values without editing the lua script. Use the following ORDERS in comment fields of schemas as follows [orders wont appear as comment code in ruby code]:

Hint: use the example schema from the '\Plugin Orders Examples' directory to learn how to use orders in comment fields!

  • ::ORDER:PATH= [Overwrite default APPDATA Path with your rails project path]
  • ::ORDER:SEED_UNITS=n [number of rows for seeds table data]
  • ::ORDER:FORCE_PKEY=T | F [replace primary keys differing from 'id' with rails default 'id']
  • ::ORDER:FORCE_FKEY=T | F [replace relation keys differing from '_id' with rails default '_id']
  • ::ORDER:FORCE_TIMESTAMPS=T | F [add timestamps [created_by/changed_by]]
  • ::ORDER:FORCE_EXCEPT=T | F [use '!' in seeds with create!]
  • ::ORDER:USE_COMMENTS=T | F [write workbench comments to files as ruby comments]
  • ::ORDER:DEBUG=T | F [set debug level in logtext output]
  • ::ORDER:USE_COMPOSITE_PKEY=T | F [allow composite primary keys with :scope]
  • ::ORDER:USE_POLYMORPHIC=T | F [auto-detect polymorphic relations]
  • ::ORDER:USE_INDEX=T | F [add index for all foreign keys]
  • ::ORDER:USE_MODELID=T | F [set additional "_id" entry for foreign keys in models]
  • ::ORDER:USE_TABLEINDEX=T | F [add table name as prefix to index names]
  • ::ORDER:ENCODING=utf-8 | "" [add encoding to first line on every rails file]

Use the following ORDERS in comment fields of tables as follows [orders wont appear in ruby code], they overwrite the global value:

  • ::ORDER:SEED_UNITS=n [number of rows for seeds table data]