Migratory Shortcuts plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install svn://rubyforge.org/var/svn/rubybrain/rails/plugins/migratory_shortcuts
Standard migration method
create_table :posts do |t| t.column :title, :string, :null => false t.column :post, :text, :null => false t.column :created_at, :datetime t.column :updated_at, :datetime t.column :created_by, :integer, :null => false t.column :updated_by, :integer, :null => false end
With migration extension
create_table :posts, :with => [:timestamp, :userstamp] do |t| t.column :title, :string, :null => false t.column :post, :text, :null => false end
There also is now a new method for creating link tables that tries to do the right thing when creating links between tables. It takes all the same options as create_table, but expects two tables as parameters.
Methods:
create_link_table(table_one, table_two, opts= {}) drop_link_table(table_one, table_two)
Special case: when the first table and the second table start with the same name, the resulting table is named with the second tables name singularized and "_links" appended.
Special Case Example:
create_link_table(:documents, :document_names) # => document_name_links
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, 9 months ago

