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
4eac6bc2
Commit
4eac6bc2
authored
Jun 15, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicate method
parent
a3023011
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
13 deletions
+4
-13
app/models/project.rb
app/models/project.rb
+1
-1
lib/gitlab/auth.rb
lib/gitlab/auth.rb
+2
-1
spec/support/shared_contexts/features/integrations/integrations_shared_context.rb
...exts/features/integrations/integrations_shared_context.rb
+1
-11
No files found.
app/models/project.rb
View file @
4eac6bc2
...
...
@@ -146,7 +146,7 @@ class Project < ApplicationRecord
has_one
:last_event
,
->
{
order
'events.created_at DESC'
},
class_name:
'Event'
has_many
:boards
def
self
.
integration_association
(
name
)
def
self
.
integration_association
_name
(
name
)
if
::
Integration
.
renamed?
(
name
)
"
#{
name
}
_integration"
else
...
...
lib/gitlab/auth.rb
View file @
4eac6bc2
...
...
@@ -160,7 +160,8 @@ module Gitlab
# We treat underscored_service as a trusted input because it is included
# in the Integration.available_services_names allowlist.
service
=
project
.
public_send
(
Project
.
integration_association
(
underscored_service
))
# rubocop:disable GitlabSecurity/PublicSend
accessor
=
Project
.
integration_association_name
(
underscored_service
)
service
=
project
.
public_send
(
accessor
)
# rubocop:disable GitlabSecurity/PublicSend
return
unless
service
&&
service
.
activated?
&&
service
.
valid_token?
(
password
)
...
...
spec/support/shared_contexts/features/integrations/integrations_shared_context.rb
View file @
4eac6bc2
...
...
@@ -5,7 +5,7 @@ Integration.available_services_names.each do |service|
include
JiraServiceHelper
if
service
==
'jira'
let
(
:dashed_service
)
{
service
.
dasherize
}
let
(
:service_method
)
{
integration_association
(
service
)
}
let
(
:service_method
)
{
Project
.
integration_association_name
(
service
)
}
let
(
:service_klass
)
{
Integration
.
integration_name_to_model
(
service
)
}
let
(
:service_instance
)
{
service_klass
.
new
}
let
(
:service_fields
)
{
service_instance
.
fields
}
...
...
@@ -57,16 +57,6 @@ Integration.available_services_names.each do |service|
service_item
end
# Returns the association name for the given integration.
# Example: 'asana' => 'asana_integration'
def
integration_association
(
name
)
if
Integration
::
RENAMED_TO_INTEGRATION
.
include?
(
name
)
"
#{
name
}
_integration"
.
to_sym
else
"
#{
name
}
_service"
.
to_sym
end
end
private
def
enable_license_for_service
(
service
)
...
...
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