-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Detect delegate
to self
#45
Labels
enhancement
New feature or request
Comments
To check how common this is, I grepped the set of apps from real-world-rails and only found a handful of occurrences:
|
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Apr 4, 2023
Fixes rubocop#45. This PR makes `Rails/Delegate` aware of `self`.
9 tasks
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Apr 4, 2023
Fixes rubocop#45. This PR makes `Rails/Delegate` aware of `self`.
koic
added a commit
that referenced
this issue
Apr 5, 2023
[Fix #45] Make `Rails/Delegate` aware of `self`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I discovered some code like this:
foo
is a class method. So callingfoo
in an instance method would be equivalent toself.class.foo
.I can't see how this confusing indirection would ever make sense. If a method needs to be available as both an instance and a class method, then there's probably a problem in the design.
Any thoughts? Should rubocop-rails detect this?
The text was updated successfully, but these errors were encountered: