diff options
author | Marcelo Silveira <marcelo@mhfs.com.br> | 2012-03-21 19:28:34 -0300 |
---|---|---|
committer | Marcelo Silveira <marcelo@mhfs.com.br> | 2012-03-21 19:28:34 -0300 |
commit | 86d1dfb821dcc31897a0899e9b0933852d33cac3 (patch) | |
tree | 3cd81f2499602732539c53a68d9dd7aec098b75d | |
parent | 0a12a5f8169685915cbb7bf4d0a7bb482f7f2fd2 (diff) | |
download | rails-86d1dfb821dcc31897a0899e9b0933852d33cac3.tar.gz rails-86d1dfb821dcc31897a0899e9b0933852d33cac3.tar.bz2 rails-86d1dfb821dcc31897a0899e9b0933852d33cac3.zip |
Avoid another blank line in generated migration and remove assertion as per @spastorino request
-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, 1 insertions, 2 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 85f0d43b77..9ca63a209e 100644 --- a/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb +++ b/activerecord/lib/rails/generators/active_record/migration/templates/migration.rb @@ -26,7 +26,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration <%= migration_action == 'add' ? 'remove' : 'add' %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'remove' %>, :<%= attribute.type %><%= attribute.inject_options %><% end %> <%- if attribute.has_index? && migration_action == 'remove' -%> add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %> - <%- end %> + <%- end -%> <%- end -%> <%- end -%> end diff --git a/railties/test/generators/migration_generator_test.rb b/railties/test/generators/migration_generator_test.rb index ad54f321a5..fd84164340 100644 --- a/railties/test/generators/migration_generator_test.rb +++ b/railties/test/generators/migration_generator_test.rb @@ -37,7 +37,6 @@ 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 |