Sha256: 42fba2c485d1ca3bf298f5c667dc6294745939d93d9baae2a2045b497cd4ddc8

Contents?: true

Size: 406 Bytes

Versions: 2

Compression:

Stored size: 406 Bytes

Contents

class BentoCreate<%= name.classify %>s < ActiveRecord::Migration
  def self.up
    create_table :<%= name.pluralize %> do |t|
      t.string :name
<% for attribute in attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
      t.timestamps
    end

    add_index :<%= name.pluralize %>, :name, :unique => true
  end

  def self.down
    drop_table :<%= name.pluralize %>
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bento-0.0.3 lib/generators/active_record/templates/create_migration.rb
bento-0.0.2 lib/generators/active_record/templates/create_migration.rb