Properly implement prepending for Concern
What does this MR do?
Properly implement prepending for Concern
We want to patch ActiveSupport::Concern
for two reasons:
- Allow defining class methods via:
class_methods
method - Allow
prepended do; end
work likeincluded do; end
If we don't need anything above, we don't need this patch nor the concern!
NOTE: Don't care too much about the implementation. It's all black magic based on ActiveSupport::Concern
. I personally think this is a very bad magic, but we're coupling with it too deeply right now to withdraw from it.
What we should focus on is the tests in spec/lib/gitlab/patch/prependable_spec.rb
. Is it what we're expecting? If not, add tests meet our expectation. We should have a bunch of use cases listed there to catch edge cases.
What are the relevant issue numbers?
CE at: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21444
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/50824
Does this MR meet the acceptance criteria?
-
Documentation created/updated -
Tests added for this feature/bug -
EE specific content should be in the top level /ee
folder
Edited by Lin Jen-Shin