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 warning from Plugin Generator #18840
Remove warning from Plugin Generator #18840
Conversation
LGTM |
@@ -319,10 +319,10 @@ def modules | |||
|
|||
def wrap_in_modules(content) | |||
content = "#{content}".strip.gsub(/\W$\n/, '') | |||
modules.reverse.inject(content) do |content, mod| | |||
modules.reverse.inject(content) do |kontent, mod| |
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.
I think it is better to rename the outside variable to unwrapped_code
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.
I'll second that. kontent
sounds like a typo (even though it mimics the klass
convention).
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.
unwrapped_code
sounds better! i'll change it.
This removes the following warning: rails/railties/lib/rails/generators/rails/plugin/plugin_generator.rb:321: warning: shadowing outer local variable - content
09d3f51
to
39af02a
Compare
updated commit. Thanks @vipulnsward @rafaelfranca for reviewing! |
…rator Remove warning from Plugin Generator
@yuki24 thank you. |
❤️ 💚 💙 💛 💜 |
This removes the following warning: