Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
75353242
Commit
75353242
authored
Aug 27, 2019
by
Winnie Hellmann
Committed by
Yorick Peterse
Aug 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace prepend_entity with prepend_if_ee
(cherry picked from commit 897a9d308db46b620b738b98f2b0e5630ac7d2dd)
parent
3cf15156
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
config/initializers/0_inject_enterprise_edition_module.rb
config/initializers/0_inject_enterprise_edition_module.rb
+9
-2
lib/api/entities.rb
lib/api/entities.rb
+18
-0
No files found.
config/initializers/0_inject_enterprise_edition_module.rb
View file @
75353242
...
...
@@ -3,8 +3,15 @@
require
'active_support/inflector'
module
InjectEnterpriseEditionModule
def
prepend_if_ee
(
constant
)
prepend
(
constant
.
constantize
)
if
Gitlab
.
ee?
def
prepend_if_ee
(
constant
,
with_descendants:
false
)
return
unless
Gitlab
.
ee?
ee_module
=
constant
.
constantize
prepend
(
ee_module
)
if
with_descendants
descendants
.
each
{
|
descendant
|
descendant
.
prepend
(
ee_module
)
}
end
end
def
extend_if_ee
(
constant
)
...
...
lib/api/entities.rb
View file @
75353242
...
...
@@ -1707,3 +1707,21 @@ module API
end
end
end
# rubocop: disable Cop/InjectEnterpriseEditionModule
API
::
Entities
.
prepend_if_ee
(
'EE::API::Entities::Entities'
)
::
API
::
Entities
::
ApplicationSetting
.
prepend_if_ee
(
'EE::API::Entities::ApplicationSetting'
)
::
API
::
Entities
::
Board
.
prepend_if_ee
(
'EE::API::Entities::Board'
)
::
API
::
Entities
::
Group
.
prepend_if_ee
(
'EE::API::Entities::Group'
,
with_descendants:
true
)
::
API
::
Entities
::
GroupDetail
.
prepend_if_ee
(
'EE::API::Entities::GroupDetail'
)
::
API
::
Entities
::
IssueBasic
.
prepend_if_ee
(
'EE::API::Entities::IssueBasic'
,
with_descendants:
true
)
::
API
::
Entities
::
List
.
prepend_if_ee
(
'EE::API::Entities::List'
)
::
API
::
Entities
::
MergeRequestBasic
.
prepend_if_ee
(
'EE::API::Entities::MergeRequestBasic'
,
with_descendants:
true
)
::
API
::
Entities
::
Namespace
.
prepend_if_ee
(
'EE::API::Entities::Namespace'
)
::
API
::
Entities
::
Project
.
prepend_if_ee
(
'EE::API::Entities::Project'
,
with_descendants:
true
)
::
API
::
Entities
::
ProtectedRefAccess
.
prepend_if_ee
(
'EE::API::Entities::ProtectedRefAccess'
)
::
API
::
Entities
::
UserPublic
.
prepend_if_ee
(
'EE::API::Entities::UserPublic'
,
with_descendants:
true
)
::
API
::
Entities
::
Todo
.
prepend_if_ee
(
'EE::API::Entities::Todo'
)
::
API
::
Entities
::
ProtectedBranch
.
prepend_if_ee
(
'EE::API::Entities::ProtectedBranch'
)
::
API
::
Entities
::
Identity
.
prepend_if_ee
(
'EE::API::Entities::Identity'
)
::
API
::
Entities
::
UserWithAdmin
.
prepend_if_ee
(
'EE::API::Entities::UserWithAdmin'
,
with_descendants:
true
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment