diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-08-30 19:05:00 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-09-11 18:45:49 +0800 |
commit | 71fefe147475bb85c67de95fba8211385cfb0a79 (patch) | |
tree | 12a8d1409f699ccd0832f6a26dad055c05b19898 /config/initializers | |
parent | c56f2b96159afaf6f1e0831d0e7a756a40568cab (diff) | |
download | gitlab-ce-71fefe147475bb85c67de95fba8211385cfb0a79.tar.gz |
Properly implement prepending for Concern
Diffstat (limited to 'config/initializers')
-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 |