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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
aeaf4e52
Commit
aeaf4e52
authored
Jan 25, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the `ee_features` docs
parent
dbf1f265
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
doc/development/ee_features.md
doc/development/ee_features.md
+27
-3
No files found.
doc/development/ee_features.md
View file @
aeaf4e52
...
...
@@ -92,12 +92,36 @@ class User < ActiveRecord::Base
# ... lots of code here ...
end
User
.
prepend_
if_ee
(
'EE::User'
)
User
.
prepend_
ee_mod
```
Do not use methods such as
`prepend`
,
`extend`
, and
`include`
. Instead, use
`prepend_if_ee`
,
`extend_if_ee`
, or
`include_if_ee`
. These methods take a
_String_
containing the full module name as the argument, not the module itself.
`prepend_ee_mod`
,
`extend_ee_mod`
, or
`include_ee_mod`
. These methods will try to
find the relevant EE module by the name of the receiver module, for example;
```
ruby
module
Vulnerabilities
class
Finding
#...
end
end
Vulnerabilities
::
Finding
.
prepend_ee_mod
```
will prepend the module named
`::EE::Vulnerabilities::Finding`
.
If the extending module does not follow this naming convention, you can also provide the module name
by using
`prepend_if_ee`
,
`extend_if_ee`
, or
`include_if_ee`
. These methods take a
_String_
containing the full module name as the argument, not the module itself, like so;
```
ruby
class
User
#...
end
User
.
prepend_if_ee
(
'::EE::UserExtension'
)
```
Since the module would require an
`EE`
namespace, the file should also be
put in an
`ee/`
sub-directory. For example, we want to extend the user model
...
...
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