Displaying 1 result from an estimated 1 matches for "table_definition".
2006 Aug 02
2
mangle ActiveRecord
...sql table, it also (optionally) creates my
created_at, deleted, key_id, session_id etc columns that I use on basically
all tables.
It would not be DRY to repeat this on all my migrations.
I figured
module ActiveRecord::ConnectionAdapters::SchemaStatements
def create_table(name, options={})
table_definition = TableDefinition.new(self)
table_definition.primary_key(options[:primary_key] || "id") unless
options[:id] == false
table_definition.column(:obj , :bigint ) unless
options[:obj] == false
table_definition.column(:session_id, :bigint ) unless
options[:session] =...