提交 e5156c95 编写于 作者: C Colin Bartlett

Fix indenting in migration generator

    $ rails generate migration remove_foo_from_bars foo:string

This currently generates:

      def up
        remove_column :bars, :foo
          end

Fix it:

      def up
        remove_column :bars, :foo
      end
上级 888fcca0
......@@ -13,9 +13,9 @@ def up
<% attributes.each do |attribute| -%>
<%- if migration_action -%>
<%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><%= attribute.inject_options %><% end %>
<% if attribute.has_index? && migration_action == 'add' %>
<%- if attribute.has_index? && migration_action == 'add' -%>
add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
<% end -%>
<%- end -%>
<%- end -%>
<%- end -%>
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册