class DynamicModel::Migration
Public Class Methods
create_for(name, &block)
click to toggle source
# File lib/database_introspection/dynamic_model/migration.rb, line 3 def self.create_for(name, &block) create_table name.to_sym do |t| block.call(t) if block_given? begin t.timestamps rescue puts "Cannot create timestamps... Probably already created." end end end
update_for(name, &block)
click to toggle source
# File lib/database_introspection/dynamic_model/migration.rb, line 14 def self.update_for(name, &block) change_table name.to_sym do |t| block.call(t) if block_given? end end