Sha256: 760f84c0d3a3bb238e3fbd76ccb8e9d947738fb21a45dd0f8e82db8a4289039b

Contents?: true

Size: 610 Bytes

Versions: 84

Compression:

Stored size: 610 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 %>
<% else -%>
      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

84 entries across 84 versions & 5 rubygems

Version Path
osc_machete_rails-2.1.2 lib/generators/active_record/templates/migration.rb
osc_machete_rails-2.1.0 lib/generators/active_record/templates/migration.rb
osc_machete_rails-2.0.0 lib/generators/active_record/templates/migration.rb
osc_machete_rails-1.3.1 lib/generators/active_record/templates/migration.rb
osc_machete_rails-1.3.0 lib/generators/active_record/templates/migration.rb
osc_machete_rails-1.2.2 lib/generators/active_record/templates/migration.rb
osc_machete_rails-2.0.0.pre1 lib/generators/active_record/templates/migration.rb
osc_machete_rails-1.2.1 lib/generators/active_record/templates/migration.rb
activerecord-4.1.16 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.1.16.rc1 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
osc_machete_rails-1.2.0 lib/generators/active_record/templates/migration.rb
activerecord-4.1.15 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.1.15.rc1 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.1.14.2 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.1.14.1 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/activerecord-4.1.13/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/activerecord-4.1.13/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/activerecord-4.1.13/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.1.14 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.1.14.rc2 lib/rails/generators/active_record/migration/templates/create_table_migration.rb