Sha256: f386615e4c6884676002faa35e0d8ce96e67dfcc37c426a68d8a2c43337de890

Contents?: true

Size: 483 Bytes

Versions: 36

Compression:

Stored size: 483 Bytes

Contents

class <%= migration_name.camelize %> < ActiveRecord::Migration
  def change
    create_table :<%= table_name %> do |t|
      t.belongs_to :<%= one %>
      t.belongs_to :<%= two %>
<%- attributes.each do |attribute| -%>
      t.<%= attribute.split(':').second %> :<%= attribute.split(':').first %>
<%- end -%>

      t.timestamps
    end
<%- if create_index? -%>
    add_index :<%= table_name %>, :<%= one %>_id
    add_index :<%= table_name %>, :<%= two %>_id
<%- end -%>
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
scaffold_plus-1.4.15 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.14 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.13 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.12 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.10 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.9 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.8 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.7 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.6 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.5 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.4 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.3 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.2 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.1 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.0 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.3.0 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb