diff options
author | Robert Speicher <robert@gitlab.com> | 2018-09-14 17:38:29 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-09-14 17:38:29 +0000 |
commit | 165e9a99c0363934e7676f3968e974af73c6cf95 (patch) | |
tree | ddeb4bbd45faaf3a8cd3efc8e28dd22c55a6f617 /config | |
parent | 69925767b7ac49b59c0292608b6655edb117e31d (diff) | |
parent | ebe89e8bd259a848d737b33a793298220054a023 (diff) | |
download | gitlab-ce-165e9a99c0363934e7676f3968e974af73c6cf95.tar.gz |
Merge branch '50824-fix-prepend-concern' into 'master'
CE: Properly implement prepending for Concern
See merge request gitlab-org/gitlab-ce!21444
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/0_as_concern.rb | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/config/initializers/0_as_concern.rb b/config/initializers/0_as_concern.rb index 40232bd6252..ff132547225 100644 --- a/config/initializers/0_as_concern.rb +++ b/config/initializers/0_as_concern.rb @@ -1,25 +1,7 @@ -# This module is based on: https://gist.github.com/bcardarella/5735987 - -module Prependable - def prepend_features(base) - if base.instance_variable_defined?(:@_dependencies) - base.instance_variable_get(:@_dependencies) << self - false - else - return false if base < self - - super - base.singleton_class.send(:prepend, const_get('ClassMethods')) if const_defined?(:ClassMethods) - @_dependencies.each { |dep| base.send(:prepend, dep) } # rubocop:disable Gitlab/ModuleWithInstanceVariables - base.class_eval(&@_included_block) if instance_variable_defined?(:@_included_block) # rubocop:disable Gitlab/ModuleWithInstanceVariables - end - end -end +# frozen_string_literal: true module ActiveSupport module Concern - prepend Prependable - - alias_method :prepended, :included + prepend Gitlab::Patch::Prependable end end |