1 class <%= class_name
.underscore
.camelize
%> < ActiveRecord
::Migration
2 def self.up
<% attributes
.each
do |attribute
| %>
3 <%= migration_action
%>_column
:<%= table_name
%>, :<%= attribute
.name
%><% if migration_action
== 'add' %>, :<%= attribute
.type
%><% end -%>
7 def self.down
<% attributes
.reverse
.each
do |attribute
| %>
8 <%= migration_action
== 'add' ? 'remove' : 'add' %>_column
:<%= table_name
%>, :<%= attribute
.name
%><% if migration_action
== 'remove' %>, :<%= attribute
.type
%><% end -%>