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
1da19431
Commit
1da19431
authored
Nov 28, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make `EE` an acronym so that helpers loading does not break
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
fa12be13
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
16 deletions
+33
-16
app/helpers/ee/issuables_helper.rb
app/helpers/ee/issuables_helper.rb
+11
-0
app/helpers/ee_issuables_helper.rb
app/helpers/ee_issuables_helper.rb
+0
-9
config/initializers/inflections.rb
config/initializers/inflections.rb
+1
-0
doc/development/ee_features.md
doc/development/ee_features.md
+21
-7
No files found.
app/helpers/ee/issuables_helper.rb
0 → 100644
View file @
1da19431
module
EE
module
IssuablesHelper
def
weight_dropdown_label
(
weight
)
if
Issue
.
weight_options
.
include?
(
weight
)
weight
else
h
(
weight
.
presence
||
'Weight'
)
end
end
end
end
app/helpers/ee_issuables_helper.rb
deleted
100644 → 0
View file @
fa12be13
module
EeIssuablesHelper
def
weight_dropdown_label
(
weight
)
if
Issue
.
weight_options
.
include?
(
weight
)
weight
else
h
(
weight
.
presence
||
'Weight'
)
end
end
end
config/initializers/inflections.rb
View file @
1da19431
...
...
@@ -11,4 +11,5 @@
#
ActiveSupport
::
Inflector
.
inflections
do
|
inflect
|
inflect
.
uncountable
%w(award_emoji)
inflect
.
acronym
'EE'
end
doc/development/ee_features.md
View file @
1da19431
...
...
@@ -15,13 +15,26 @@ as much as possible.
### Code in `app/`
Place EE-specific controllers, models, services, workers in the top-level
`EE`
module namespace.
Place EE-specific controllers, finders, helpers, mailers, models, policies,
serializers/entities, services, validators and workers in the top-level
`EE`
module namespace, and in a specific
`/ee/`
sub-folder:
-
`app/controllers/ee/foos_controller.rb`
-
`app/finders/ee/foos_finder.rb`
-
`app/helpers/ee/foos_helper.rb`
-
`app/mailers/ee/foos_mailer.rb`
-
`app/models/ee/foo.rb`
-
`app/policies/ee/foo_policy.rb`
-
`app/serializers/ee/foo_entity.rb`
-
`app/serializers/ee/foo_serializer.rb`
-
`app/services/ee/foo/create_service.rb`
-
`app/validators/ee/foo_attr_validator.rb`
-
`app/workers/ee/foo_worker.rb`
If you modify an existing part of a CE controller, model, service, worker etc.
one simple solution is to use the
`prepend`
strategy (
presented below
).
one simple solution is to use the
`prepend`
strategy (
[
presented below
](
#overriding-ce-methods
)
).
For example to override CE implementation of
For example to override
the
CE implementation of
`ApplicationController#after_sign_out_path_for`
:
```
ruby
...
...
@@ -120,9 +133,10 @@ fun to resolve when you add the indentation to the equation.
### Code in `lib/`
Place EE-specific logic in the top-level
`EE`
module namespace. Namespace the
class beneath the
`EE`
module just as you would normally. For example, if CE
has LDAP classes in
`lib/gitlab/ldap/`
then you would place EE-specific LDAP
classes in
`lib/ee/gitlab/ldap`
.
class beneath the
`EE`
module just as you would normally.
For example, if CE has LDAP classes in
`lib/gitlab/ldap/`
then you would place
EE-specific LDAP classes in
`lib/ee/gitlab/ldap`
.
### Classes vs. Module Mixins
...
...
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