Commit 59118a90 authored by Igor Drozdov's avatar Igor Drozdov

Fix Prependable module for Rails 6.1

Rails 6.1 allows to prepend concerns

But the Rails implementation does not work well when
both modules extend ActiveSupport::Concern:

https://github.com/rails/rails/pull/42067

Let's keep our own implementation until it's fixed


(cherry picked from commit 841e0c1d42012c4aa5d525b0b66cb02052b90db6)
parent a50462d6
......@@ -21,7 +21,12 @@ module Gitlab
def prepend_features(base)
return false if prepended?(base)
super
# Rails 6.1 allows prepending of the modules, but it doesn't
# work well when both modules extend ActiveSupport::Concern
# https://github.com/rails/rails/pull/42067
#
# Let's keep our own implementation, until the issue is fixed
Module.instance_method(:prepend_features).bind(self).call(base)
if const_defined?(:ClassMethods)
klass_methods = const_get(:ClassMethods, false)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment