Sha256: 07dbf22f914a056f0b82941cb4f0903317da6856577dea897f1fb6c6b5457425
Contents?: true
Size: 660 Bytes
Versions: 10
Compression:
Stored size: 660 Bytes
Contents
class <%= migration_class_name %> < ActiveRecord::Migration def change create_table :<%= table_name %> do |t| <% attributes.each do |attribute| -%> <% if attribute.password_digest? -%> t.string :password_digest<%= attribute.inject_options %> <% elsif !%w(asset content).include?(attribute.type.to_s) -%> t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %> <% end -%> <% end -%> <% if options[:timestamps] %> t.timestamps <% end -%> end <% attributes_with_index.each do |attribute| -%> add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %> <% end -%> end end
Version data entries
10 entries across 10 versions & 1 rubygems