Sha256: 8831bdc52fd1d54c7b2de3e7eaf3af88cf9b2062d86ddb28e879973c70ede1fe

Contents?: true

Size: 367 Bytes

Versions: 11

Compression:

Stored size: 367 Bytes

Contents

class <%= "Create#{class_name.pluralize}" %> < ActiveRecord::Migration

  def self.up
    create_table :<%= table_name %> do |t|
<% attributes.each do |attribute| -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>

      t.timestamps
    end

    add_index :<%= table_name %>, :id

  end

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

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
soapbox-0.2.6 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.2.5 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.2.4 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.2.3 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.2.2 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.2.1 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.2.0 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.1.7 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.1.3 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.1.2 lib/generators/soapbox_scaffold/templates/migration.rb
soapbox-0.1.1 lib/generators/soapbox_scaffold/templates/migration.rb