diff options
Diffstat (limited to 'lib/gitlab/patch')
-rw-r--r-- | lib/gitlab/patch/draw_route.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/patch/prependable.rb | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/gitlab/patch/draw_route.rb b/lib/gitlab/patch/draw_route.rb index f5fcd5c6093..61b25065e8f 100644 --- a/lib/gitlab/patch/draw_route.rb +++ b/lib/gitlab/patch/draw_route.rb @@ -10,7 +10,7 @@ module Gitlab def draw(routes_name) drawn_any = draw_ee(routes_name) | draw_ce(routes_name) - drawn_any || raise(RoutesNotFound.new("Cannot find #{routes_name}")) + drawn_any || raise(RoutesNotFound, "Cannot find #{routes_name}") end def draw_ce(routes_name) @@ -37,4 +37,4 @@ module Gitlab end end -Gitlab::Patch::DrawRoute.prepend_if_ee('EE::Gitlab::Patch::DrawRoute') +Gitlab::Patch::DrawRoute.prepend_mod_with('Gitlab::Patch::DrawRoute') diff --git a/lib/gitlab/patch/prependable.rb b/lib/gitlab/patch/prependable.rb index dde78cd9178..1ed341e1c26 100644 --- a/lib/gitlab/patch/prependable.rb +++ b/lib/gitlab/patch/prependable.rb @@ -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) |