-
-
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
Cop request: private delegates #368
Comments
Sidenote: The |
I've had the same desire and would like to build this feature! is it okay if I go ahead and start working on it following the contribution guidelines? or is there any other protocol to follow up on? |
I started working on this. But what to do (in terms of auto-correction) when private option is passed, but there is mismatch in the scope? E.g.
Should we instead of changing the private option, move the node? Or register an offense with a different message (than in the missing private option) and do not attempt to auto-correct? |
Is your feature request related to a problem? Please describe.
When using
#delegate
, ActiveSupport creates a new method on the class, but this method does not respect the visibility scope of said class.For example:
The generated method
#baz
will not be private. The#delegate
method does, however, provide an option to create a private method like so:Describe the solution you'd like
I would like a cop that detects calls to
#delegate
that:private
scope.private: true
option.The text was updated successfully, but these errors were encountered: