Sha256: 4bb57e175251b72fdc8e0e2b6101807eabd80014be37f6ca957b74a3684712a2
Contents?: true
Size: 624 Bytes
Versions: 8
Compression:
Stored size: 624 Bytes
Contents
class <%= migration_class_name %> < ActiveRecord::Migration def change <% @migration_types.each do |type| -%> create_table :<%= type.model_name.collection %> do |t| <% type.attributes.each do |attribute| -%> t.<%= attribute.migration_type %> :<%= attribute.name %><%= attribute.inject_options %> <% end -%> t.belongs_to :author <% if type.options[:timestamps] -%> t.timestamps <% end -%> end <% type.attributes_with_index.each do |attribute| -%> add_index :<%= type.model_name.collection %>, :<%= attribute.index_name %><%= attribute.inject_index_options %> <% end -%> <% end -%> end end
Version data entries
8 entries across 8 versions & 1 rubygems