mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove an empty line from generated migration
Currently, if you run `rails g migration remove_column_from_models`, there is an empty line before `remove_column` line because we forgot to use `-%>` in the template: $ bin/rails g migration remove_title_from_posts title:string invoke active_record create db/migrate/20200114061235_remove_title_from_posts.rb $ cat db/migrate/20200114061235_remove_title_from_posts.rb class RemoveTitleFromPosts < ActiveRecord::Migration[6.1] def change remove_column :posts, :title, :string end end This commit adds the missing `-` in front of `-%>` to make it removes the empty line.
This commit is contained in:
parent
5371d5dcf2
commit
0ac7b8c843
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
|
|||
<%- if attribute.has_index? -%>
|
||||
remove_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
|
||||
<%- end -%>
|
||||
<%- if !attribute.virtual? %>
|
||||
<%- if !attribute.virtual? -%>
|
||||
remove_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
|
||||
<%- end -%>
|
||||
<%- end -%>
|
||||
|
|
Loading…
Reference in a new issue