Sha256: f5ed9fde7af1cc2801f54c3c7a87a70a2e21b026178c47e8de5c4e799b065ef8
Contents?: true
Size: 554 Bytes
Versions: 2
Compression:
Stored size: 554 Bytes
Contents
class <%= @activity.camelize.gsub(/\s/, '') %> < ActiveRecord::Migration<%= @class_suffix %> def self.up create_table :<%= @table_name %> do |t| <% @columns.each do |field, options| %> t.<%= options.delete(:type) %> :<%= field %><%= (options.blank?)? '': ", "+options.to_a.collect { |o| ":#{o[0]}=>#{o[1].inspect}" }.sort.join(', ') %> <% end %> end <% @indexes.each do |index| %> add_index :<%= @table_name %>, <%= index.inspect %> <% end -%> end def self.down drop_table :<%= @table_name %> end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
migrant-2.0.0 | lib/generators/templates/create_migration.erb |
migrant-2.0.0.pre | lib/generators/templates/create_migration.erb |