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
Rails/ActiveRecordOverride crashing on modules #6943
Comments
Same error
|
happens on all rubocop version - seems to be the cop itself i didn't look into this properly now but this workaround might help someone landing in this issue
|
I also found the same problem, modules don't have a parent class so the code fails when we ask for the return unless %w[ApplicationRecord ActiveModel::Base]
.include?(parent_class.const_name) I will create a PR to return early when there is no parent class since we can't determine if the methods are overriding active record. |
Thanks for that, any ideas when that’ll be on rubygems? |
Rails/ActiveRecordOverride
crashes on the following code:Note that it does not crash if the module only contains 1 method.
This is the same root cause as #6888 but I logged it separately as it impacts modules, which IMO this cop shouldn't check.
Expected behavior
Don't crash, but record a lint error.
Actual behavior
Crash.
Steps to reproduce the problem
Code above.
RuboCop version
0.67.2 (using Parser 2.6.2.1, running on ruby 2.5.3 x86_64-darwin15)
The text was updated successfully, but these errors were encountered: