Remove blank line from generated migration #5532

Merged
merged 1 commit into from Mar 21, 2012

Conversation

Projects
None yet
3 participants
Contributor

mhfs commented Mar 21, 2012

When creating a migration with attributes the change method is being generated with an empty line.

script/rails g migration add_uid_to_users uid:integer
class AddUidToUsers < ActiveRecord::Migration
  def change
    add_column :users, :uid, :integer

  end
end

Cheers!

josevalim added a commit that referenced this pull request Mar 21, 2012

Merge pull request #5532 from mhfs/migration_blank_line
Remove blank line from generated migration

@josevalim josevalim merged commit 14b2cf6 into rails:master Mar 21, 2012

@@ -37,6 +37,7 @@ def test_add_migration_with_attributes
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)
@spastorino

spastorino Mar 21, 2012

Owner

I wouldn't test that our generated files has or has not X empty lines

@mhfs

mhfs Mar 21, 2012

Contributor

yeah, I agree it's kind of weird ... do want me to remove it?

I'll fix a new empty line that just got in today anyway...

@spastorino

spastorino Mar 21, 2012

Owner

Do it if you want and cc me :). Thanks.

@mhfs

mhfs Mar 21, 2012

Contributor

Done =D

#5540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment