Sha256: 3b73011a823890e6c2ab5a3fd9c4f2558d9e2d29de2d623deaa9cf2b768a2eab

Contents?: true

Size: 614 Bytes

Versions: 16

Compression:

Stored size: 614 Bytes

Contents

class Create<%= table_name.camelize %> < ActiveRecord::Migration
  def self.up
    create_table :<%= table_name %> do |t|
      t.menuable
      
<% for attribute in attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>

      t.timestamps
    end

    # add_index :<%= table_name %>, :lft
    # add_index :<%= table_name %>, :rgt
    # add_index :<%= table_name %>, :parent_id
    add_index :<%= table_name %>, :url
    add_index :<%= table_name %>, :marketable_url
    # add_index :<%= table_name %>, :cable_menuable_id

  end

  def self.down
    drop_table :<%= table_name %>
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cable-0.9.17 lib/generators/cable/menu/templates/migration.rb
cable-0.9.16 lib/generators/cable/menu/templates/migration.rb
cable-0.9.15 lib/generators/cable/menu/templates/migration.rb
cable-0.9.14 lib/generators/cable/menu/templates/migration.rb
cable-0.9.13 lib/generators/cable/menu/templates/migration.rb
cable-0.9.12 lib/generators/cable/menu/templates/migration.rb
cable-0.9.11 lib/generators/cable/menu/templates/migration.rb
cable-0.9.10 lib/generators/cable/menu/templates/migration.rb
cable-0.9.9 lib/generators/cable/menu/templates/migration.rb
cable-0.9.8 lib/generators/cable/menu/templates/migration.rb
cable-0.9.6 lib/generators/cable/menu/templates/migration.rb
cable-0.9.5 lib/generators/cable/menu/templates/migration.rb
cable-0.9.4 lib/generators/cable/menu/templates/migration.rb
cable-0.9.3 lib/generators/cable/menu/templates/migration.rb
cable-0.9.1 lib/generators/cable/menu/templates/migration.rb
cable-0.9.0 lib/generators/cable/menu/templates/migration.rb