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
dda05d4f
Commit
dda05d4f
authored
Aug 27, 2020
by
Arturo Herrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve readability for private class methods
parent
8f03f0f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
app/models/service.rb
app/models/service.rb
+6
-3
No files found.
app/models/service.rb
View file @
dda05d4f
...
...
@@ -154,7 +154,7 @@ class Service < ApplicationRecord
for_template
end
private_class_method
def
self
.
create_nonexistent_templates
def
self
.
create_nonexistent_templates
nonexistent_services
=
list_nonexistent_services_for
(
for_template
)
return
if
nonexistent_services
.
empty?
...
...
@@ -165,6 +165,7 @@ class Service < ApplicationRecord
end
end
end
private_class_method
:create_nonexistent_templates
def
self
.
find_or_initialize_integration
(
name
,
instance:
false
,
group_id:
nil
)
if
name
.
in?
(
available_services_names
)
...
...
@@ -176,15 +177,17 @@ class Service < ApplicationRecord
scope
+
build_nonexistent_services_for
(
scope
)
end
private_class_method
def
self
.
build_nonexistent_services_for
(
scope
)
def
self
.
build_nonexistent_services_for
(
scope
)
list_nonexistent_services_for
(
scope
).
map
do
|
service_type
|
service_type
.
constantize
.
new
end
end
private_class_method
:build_nonexistent_services_for
private_class_method
def
self
.
list_nonexistent_services_for
(
scope
)
def
self
.
list_nonexistent_services_for
(
scope
)
available_services_types
-
scope
.
map
(
&
:type
)
end
private_class_method
:list_nonexistent_services_for
def
self
.
available_services_names
service_names
=
services_names
...
...
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