We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, found out that Rails/LexicallyScopedActionFilter doesn't consider method aliases.
Rails/LexicallyScopedActionFilter
I believe that the cop should consider aliased methods as explicitly defined.
The cop ignored method alias.
class FooController < ApplicationController before_action :authorize!, only: %i[index show] def index end alias_method :show, :index private def authorize! end end
This example will produce Rails/LexicallyScopedActionFilter: show is not explicitly defined on the class.
Rails/LexicallyScopedActionFilter: show is not explicitly defined on the class.
$ [bundle exec] rubocop -V 1.20.0 (using Parser 3.0.2.0, rubocop-ast 1.11.0, running on ruby 2.7.4 x86_64-darwin20) - rubocop-performance 1.11.5 - rubocop-rails 2.11.3 - rubocop-rspec 2.4.0
The text was updated successfully, but these errors were encountered:
[Fix rubocop#529] Fix a false positive for `Rails/LexicallyScopedActi…
312cdde
…onFilter` Fixes rubocop#529. This PR fixes a false positive for `Rails/LexicallyScopedActionFilter` when action method is aliased by `alias_method`.
660ffe7
03ed951
Merge pull request #531 from koic/fix_a_false_positive_for_rails_lexi…
1f40f4b
…cally_scoped_action_filter [Fix #529] Fix a false positive for `Rails/LexicallyScopedActionFilter`
Successfully merging a pull request may close this issue.
Hello, found out that
Rails/LexicallyScopedActionFilter
doesn't consider method aliases.Expected behavior
I believe that the cop should consider aliased methods as explicitly defined.
Actual behavior
The cop ignored method alias.
Steps to reproduce the problem
This example will produce
Rails/LexicallyScopedActionFilter: show is not explicitly defined on the class.
RuboCop version
The text was updated successfully, but these errors were encountered: