-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
False positive Rails/LexicallyScopedActionFilter when conditional statement used #5448
Comments
Thanks for the bug report! The cause is here. https://github.com/bbatsov/rubocop/blob/87f453d20f789fb4cb233a661dbed8794502022a/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb#L70 |
What about filters inserted via mixins? Will they be addressed too when this issue is resolved? module FooMixin
extend ActiveSupport::Concern
included do
before_action proc { authenticate },
only: :foo
end
def foo; end
end
class BarController < ActionController
include FooMixin
end |
Fixes rubocop#5448 In addition, I also made it possible to inspect modules like mixin. See also rubocop#5448 (comment)
Fixes #5448 In addition, I also made it possible to inspect modules like mixin. See also #5448 (comment)
Fixes #5448 In addition, I also made it possible to inspect modules like mixin. See also rubocop/rubocop#5448 (comment)
Rails/LexicallyScopedActionFilter gives false positive when before action used with conditional statement
Expected behavior
No offenses.
Actual behavior
Steps to reproduce the problem
Use this test class in the /controllers directory
RuboCop version
The text was updated successfully, but these errors were encountered: