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