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

Version Path
lanes-0.6.1 templates/db/create_table_migration.rb
lanes-0.6.0 templates/db/create_table_migration.rb
lanes-0.5.6 templates/db/create_table_migration.rb
lanes-0.5.5 templates/db/create_table_migration.rb
lanes-0.5.0 templates/db/create_table_migration.rb
lanes-0.4.0 templates/db/create_table_migration.rb
lanes-0.3.0 templates/db/create_table_migration.rb
lanes-0.1.9.5 templates/db/create_table_migration.rb
lanes-0.1.9 templates/db/create_table_migration.rb
lanes-0.1.8 templates/db/create_table_migration.rb
lanes-0.1.7 templates/db/create_table_migration.rb
lanes-0.1.6 templates/db/create_table_migration.rb