Sha256: 3fd70a64bd3314e00d1ab1df1a9eba0357889911a9b3d74bfab9c9994b3d3667
Contents?: true
Size: 493 Bytes
Versions: 14
Compression:
Stored size: 493 Bytes
Contents
class <%= @activity.camelize.gsub(/\s/, '') %> < ActiveRecord::Migration def self.up create_table :<%= @table_name %> do |t| <% @columns.each do |field, options| %> t.<%= options.delete(:type) %> :<%= field %><%= (options.blank?)? '': ", "+options.inspect[1..-2] %> <% end %> end <% @indexes.each do |index, options| %> add_index :<%= @table_name %>, <%= index.inspect %> <% end -%> end def self.down drop_table :<%= @table_name %> end end
Version data entries
14 entries across 14 versions & 1 rubygems