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.9.1 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.9.0 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.8.0 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.14 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.13 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.12 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.11 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.10 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.9 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.8 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.7 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.6 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.5 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.4 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.3 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.1 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.7.0 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.6.0 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.5.0 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb
scaffold_plus-1.4.16 lib/generators/scaffold_plus/many_to_many/templates/many_to_many_migration.rb