aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-03-21 18:03:17 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-03-21 18:03:17 -0700
commit64249223ebb2b51814d8764c498b14a12d072b83 (patch)
tree43d0b7c9e9bcb497baad522ce7d4fb55120e131c
parentb6c128d6d07e806ae9d4d4f41c448c9cb3fbd14f (diff)
parent86d1dfb821dcc31897a0899e9b0933852d33cac3 (diff)
downloadrails-64249223ebb2b51814d8764c498b14a12d072b83.tar.gz
rails-64249223ebb2b51814d8764c498b14a12d072b83.tar.bz2
rails-64249223ebb2b51814d8764c498b14a12d072b83.zip
Merge pull request #5540 from mhfs/another_blank_line_fix
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.rb2
-rw-r--r--railties/test/generators/migration_generator_test.rb1
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