diff options
author | Marcelo Silveira <marcelo@mhfs.com.br> | 2012-03-20 21:44:45 -0300 |
---|---|---|
committer | Marcelo Silveira <marcelo@mhfs.com.br> | 2012-03-20 21:44:45 -0300 |
commit | c63306b1a837de370abf905fced2ad5518c43c6f (patch) | |
tree | b4e522555f0e264f0bf719608db99655bb6b0536 | |
parent | b49a7ddce18a35a39fd5b3f6003d4a02cbd09b0e (diff) | |
download | rails-c63306b1a837de370abf905fced2ad5518c43c6f.tar.gz rails-c63306b1a837de370abf905fced2ad5518c43c6f.tar.bz2 rails-c63306b1a837de370abf905fced2ad5518c43c6f.zip |
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 4e08e5dae1..083abc1afa 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 |