Sha256: a6444938f0afecdcad6a81dc2172ed94e7e885528e1523869454fc0699ad114f

Contents?: true

Size: 358 Bytes

Versions: 4

Compression:

Stored size: 358 Bytes

Contents

class <%=@migration.camelize %><%=@table_name.camelize %> < ActiveRecord::Migration
  def self.up
    <% @add_columns.each do |col| %>
      add_column :<%=@table_name %>, :<%=col.name %>, :<%=col.type %>
    <% end %>
  end
  def self.down
    <% @add_columns.each do |col| %>
      remove_column :<%=@table_name %>, :<%=col.name %>
    <% end %>
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
flatten_record-1.0.11 lib/generators/flatten_record/migration/templates/update.erb
flatten_record-1.0.10 lib/generators/flatten_record/migration/templates/update.erb
flatten_record-1.0.9 lib/generators/flatten_record/migration/templates/update.erb
flatten_record-1.0.7 lib/generators/flatten_record/migration/templates/update.erb