Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new-line to the end of route method generated code. #19387

Merged
merged 1 commit into from
Mar 19, 2015

Conversation

arthurnn
Copy link
Member

Fix regression on route method that was added by
bac812a. The regression was that when
calling the route method, we were not appending a \n anymore.

[fixes #19316]

review @rafaelfranca @pixeltrix

Fix regression on route method that was added by
bac812a. The regression was that when
calling the `route` method, we were not appending a \n anymore.

[fixes rails#19316]
@rafaelfranca
Copy link
Member

:shipit:

@mattbrictson
Copy link
Contributor

This fixes the bug, but it still means that there is a slight (inconsequential?) difference in behavior from 4.2.0. The scaffold generator used to add an extra newline; now it does not.

4.2.0 after running rails g scaffold for user and post:

Rails.application.routes.draw do
  resources :users

  resources :posts

end

4.2.1:

Rails.application.routes.draw do
  resources :users
  resources :posts
end

Again, this is just a whitespace difference. No big deal? (I think I actually prefer the new behavior.)

@sevenseacat
Copy link
Contributor

👍

@carlosantoniodasilva
Copy link
Member

Sounds 👍

arthurnn pushed a commit that referenced this pull request Mar 19, 2015
Add a new-line to the end of route method generated code.
@arthurnn arthurnn merged commit bee9434 into rails:master Mar 19, 2015
@arthurnn arthurnn deleted the fix_route_regression branch March 19, 2015 13:19
arthurnn pushed a commit that referenced this pull request Mar 19, 2015
Add a new-line to the end of route method generated code.
Conflicts:
	railties/CHANGELOG.md
arthurnn pushed a commit that referenced this pull request Mar 19, 2015
Add a new-line to the end of route method generated code.
Conflicts:
	railties/CHANGELOG.md
@arthurnn
Copy link
Member Author

Merged to master.
Backported to 4-2-stable: ab4fa1f
and 4-2-1: b42f3fc

arthurnn pushed a commit that referenced this pull request Mar 19, 2015
Add a new-line to the end of route method generated code.
arthurnn pushed a commit that referenced this pull request Mar 19, 2015
Add a new-line to the end of route method generated code.
@pixeltrix
Copy link
Contributor

Thanks for doing this @arthurnn - been slammed at work for the past few days

@arthurnn
Copy link
Member Author

this was backported to 4-1-stable too 836d1fd , and it is on the 4.1.10 release.

@pixeltrix no worries bro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.2.1.rc4: route generator action gobbles up trailing newline, breaks 3rd-party generators
6 participants