<%=migration_action%>_column :<%= table_name %>,:<%=attribute.name%><% if migration_action == 'add' %>,:<%=attribute.type%><% end %>
...
...
@@ -7,7 +7,7 @@ def self.up
<%- end -%>
end
defself.down
defdown
<% attributes.reverse.each do|attribute|-%>
<%- if migration_action -%>
<%= migration_action =='add'?'remove':'add'%>_column:<%=table_name%>, :<%= attribute.name %><% if migration_action=='remove'%>,:<%=attribute.type%><% end %>