Commit d503dbe8 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Rename `prepend_ee_mod` to `prepend_mod`

parent c5274720
......@@ -556,4 +556,4 @@ class ApplicationController < ActionController::Base
end
end
ApplicationController.prepend_ee_mod
ApplicationController.prepend_mod
......@@ -141,4 +141,4 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap
end
end
Projects::MergeRequests::CreationsController.prepend_ee_mod
Projects::MergeRequests::CreationsController.prepend_mod
......@@ -21,4 +21,4 @@ module Types
end
end
Types::AlertManagement::HttpIntegrationType.prepend_ee_mod
Types::AlertManagement::HttpIntegrationType.prepend_mod
......@@ -51,4 +51,4 @@ module ProfilesHelper
end
end
ProfilesHelper.prepend_ee_mod
ProfilesHelper.prepend_mod
......@@ -60,4 +60,4 @@ module Ci
end
end
Ci::PipelineArtifact.prepend_ee_mod
Ci::PipelineArtifact.prepend_mod
......@@ -43,4 +43,4 @@ module Ci
end
end
Ci::Artifactable.prepend_ee_mod
Ci::Artifactable.prepend_mod
......@@ -21,4 +21,4 @@ class ProjectSetting < ApplicationRecord
end
end
ProjectSetting.prepend_ee_mod
ProjectSetting.prepend_mod
......@@ -17,4 +17,4 @@ class Vulnerability < ApplicationRecord
end
end
Vulnerability.prepend_ee_mod
Vulnerability.prepend_mod
......@@ -129,4 +129,4 @@ module AlertManagement
end
end
AlertManagement::AlertProcessing.prepend_ee_mod
AlertManagement::AlertProcessing.prepend_mod
......@@ -10,4 +10,4 @@ module Issues
end
end
Issues::AfterCreateService.prepend_ee_mod
Issues::AfterCreateService.prepend_mod
......@@ -75,4 +75,4 @@ module Issues
end
end
Issues::CreateService.prepend_ee_mod
Issues::CreateService.prepend_mod
......@@ -38,4 +38,4 @@ module Users
end
end
Users::ActivityService.prepend_ee_mod
Users::ActivityService.prepend_mod
......@@ -54,4 +54,4 @@ class JsonSchemaValidator < ActiveModel::EachValidator
end
end
JsonSchemaValidator.prepend_ee_mod
JsonSchemaValidator.prepend_mod
......@@ -27,17 +27,14 @@ module InjectEnterpriseEditionModule
def prepend_mod(with_descendants: false)
prepend_mod_for(name, with_descendants: with_descendants)
end
alias_method :prepend_ee_mod, :prepend_mod
def extend_mod
each_extension_for(name, Object, &method(:extend))
end
alias_method :extend_ee_mod, :extend_mod
def include_mod
each_extension_for(name, Object, &method(:include))
end
alias_method :include_ee_mod, :include_mod
private
......
......@@ -94,11 +94,11 @@ class User < ActiveRecord::Base
# ... lots of code here ...
end
User.prepend_ee_mod
User.prepend_mod
```
Do not use methods such as `prepend`, `extend`, and `include`. Instead, use
`prepend_ee_mod`, `extend_ee_mod`, or `include_ee_mod`. These methods will try to
`prepend_mod`, `extend_mod`, or `include_mod`. These methods will try to
find the relevant EE module by the name of the receiver module, for example;
```ruby
......@@ -108,7 +108,7 @@ module Vulnerabilities
end
end
Vulnerabilities::Finding.prepend_ee_mod
Vulnerabilities::Finding.prepend_mod
```
will prepend the module named `::EE::Vulnerabilities::Finding`.
......
......@@ -297,4 +297,4 @@ module API
end
end
API::API.prepend_ee_mod
API::API.prepend_mod
......@@ -164,4 +164,4 @@ module Gitlab
end
end
Gitlab::SearchContext::Builder.prepend_ee_mod
Gitlab::SearchContext::Builder.prepend_mod
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