-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
[Fix #51] Add ability to whitelist receiver class names #69
Conversation
Maybe we can check if the receiver inherits from |
This is not reliable. A class can extend from |
A = Class.new ActiveRecord::Base
B = Class.new A
B <= ActiveRecord::Base
=> true |
@krzysiek1507 RuboCop uses static analysis, It doesn't run the code, so this approach isn't possible. |
31cf95d
to
b5e9504
Compare
c1894ce
to
5e272f0
Compare
5e272f0
to
2b3d477
Compare
Thank you for this PR :) |
2b3d477
to
73dc64f
Compare
Rebased & fixed merge conflicts. @koic |
06a9074
to
0cfe340
Compare
ddda677
to
5a9b9fe
Compare
@koic Fixed as per review comments. |
In `Rails/DynamicFindBy`. Also use `AllowedReceivers` & `AllowedMethods` instead of `Whitelist` which will be deprecated soon. Fixes rubocop#51.
5a9b9fe
to
43b6d78
Compare
@koic Thanks for the review :) I have fixed as per your suggestions. |
Nicely done 👍 |
In
Rails/DynamicFindBy
.Fixes #51.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.