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
remove useless rescue #2647
remove useless rescue #2647
Conversation
rescue NoMethodError | ||
false | ||
end || Rails.application.config.assets.debug | ||
params[:debug_assets] == '1' || params[:debug_assets] == 'true' || Rails.application.config.assets.debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you split this line up? Or perhaps use a more concise version, e.g.:
%w(1 true).include?(params[:debug_assets]) || Rails.application.config.assets.debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that's something I can do. I don't like the %w format though (that's a very personal opinion) though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['1', 'true']
is still an improvement. I'm on a crusade against long lines in Rails these days.
I prefer the first version is more readable and faster you can split the lines anyway ...
|
params is a method, defined in every controller, which always returns a hash. If it raises a NoMethodError, it means there's a bug somewhere else, which we want to know about.
I've changed it. Thank you for your opinion :) |
This reverts commit 125b1b0.
This reverts commit 125b1b0.
This reverts commit 125b1b0.
* 3-1-0: bumping to 3.1.0 Bump sprockets up Depend on sass-rails and coffee-rails 3.1.0 Revert "Merge pull request #2647 from dmathieu/no_rescue" Merge pull request #2756 from guilleiguaran/manifest-location Merge pull request #2748 from guilleiguaran/assets-version-config adds the asset pipeline guide to the index incorporate feedback from vijaydev and dasch to rephrase this to sound more natural, and some grammar fixes.
params is a method, defined in every controller, which always returns a hash.
If it raises a NoMethodError, it means there's a bug somewhere else, which we want to know about.