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
[ActiveSupport] Fix for #20489 - ActiveSupport::Concern#class_methods affects parent classes #20494
[ActiveSupport] Fix for #20489 - ActiveSupport::Concern#class_methods affects parent classes #20494
Conversation
Tests are broken, could you take a look? |
@rafaelfranca I was pretty tired so I thought I'd do it today. Should've left a comment, sorry about that. I was working on master. I just created an empty pull request, just to see if all tests on master are passing, and they are not: Should I rebase my changes on top of another branch (one for which the tests are passing) and try again? Which one would you recommend (maybe 4-2-stable)? |
master is green as you can see here https://travis-ci.org/rails/rails/branches. You patch broke two tests. |
@rafaelfranca Ok, thanks. I didn't see that there's |
The problem was in I've changed the test to reduce pollution, but it still needs to include |
Can we have one more level of constants? Or this bug only happen if the |
If I understood it correctly, it happens only when
|
O_O. How is this bug happening in the wild? Is someone opening one of these Modules? |
This line was triggering the bug in my app: |
@@ -54,6 +54,12 @@ module Foo | |||
include Bar, Baz | |||
end | |||
|
|||
module Qux | |||
extend ActiveSupport::Concern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this extend needed? mongoid does not extend it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I just need to manually call Object.extend in that case. Should I remove it and add Object.extend call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Looks good
Could you squash your commits? I'm going to merge it. BTW, great work |
👍 on great work, this was an excellent find. |
45b3629
to
f98e75a
Compare
Thanks :) I've squashed the commits, let me know if you need anything else. |
…s_methods_fix [ActiveSupport] Fix for #20489 - ActiveSupport::Concern#class_methods affects parent classes
…s_methods_fix [ActiveSupport] Fix for #20489 - ActiveSupport::Concern#class_methods affects parent classes
Backported as d06e425 |
This PR includes a test that reproduces the issue described in #20489 and a fix for it. Here's a short explanation of the issue by @ewoutkleinsmann: