diff options
author | José Valim <jose.valim@gmail.com> | 2012-03-21 00:28:38 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-03-21 00:28:38 -0700 |
commit | f829515ad9ca386bf1ae7f2dc342ee3d883ab3be (patch) | |
tree | cee3f52c4ccf0e9f7e0bc012968bfe3a53b63480 | |
parent | 275ee0dc7b836fb10aa8af1c0339e81539c1dec1 (diff) | |
parent | 57c6b4c0fe3998d9d35e0d6a924dc135b9f47d84 (diff) | |
download | rails-f829515ad9ca386bf1ae7f2dc342ee3d883ab3be.tar.gz rails-f829515ad9ca386bf1ae7f2dc342ee3d883ab3be.tar.bz2 rails-f829515ad9ca386bf1ae7f2dc342ee3d883ab3be.zip |
Merge pull request #5533 from mhfs/migration_blank_line_3_2
[3-2-stable] Remove blank line from generated migration
-rw-r--r-- | activerecord/lib/rails/generators/active_record/migration/templates/migration.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/migration_generator_test.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb b/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb index d084a00ed7..aec5c429fe 100644 --- a/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb +++ b/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb @@ -5,7 +5,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration add_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %> <%- if attribute.has_index? -%> add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %> - <%- end %> + <%- end -%> <%- end -%> end <%- else -%> diff --git a/railties/test/generators/migration_generator_test.rb b/railties/test/generators/migration_generator_test.rb index 3f4e160988..8d49faacf1 100644 --- a/railties/test/generators/migration_generator_test.rb +++ b/railties/test/generators/migration_generator_test.rb @@ -37,6 +37,7 @@ class MigrationGeneratorTest < Rails::Generators::TestCase assert_method :change, content do |up| assert_match(/add_column :posts, :title, :string/, up) assert_match(/add_column :posts, :body, :text/, up) + assert_no_match(/\n\n/, up) end end end |