Sha256: 2595f97280b4476a3b86d054eed587d15fedf8d594323601bfe17bdc01050fb3
Contents?: true
Size: 654 Bytes
Versions: 12
Compression:
Stored size: 654 Bytes
Contents
class Create<%= class_name.pluralize %> < ActiveRecord::Migration def change create_table :<%= table_name %> do |t| <% fields.each do |attribute| -%> <% if attribute.password_digest? -%> t.string :password_digest<%= attribute.inject_options %> <% else -%> t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %> <% end -%> <% end -%> <% if options[:timestamps] %> t.timestamps null: false <% end -%> end <% fields_with_index.each do |attribute| -%> add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %> <% end -%> end end
Version data entries
12 entries across 12 versions & 1 rubygems