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
32af384a
Commit
32af384a
authored
Aug 09, 2018
by
gfyoung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen string in rest of app/models/**/*.rb
Partially addresses #47424.
parent
ce2f1ec8
Changes
56
Hide whitespace changes
Inline
Side-by-side
Showing
56 changed files
with
127 additions
and
14 deletions
+127
-14
app/models/programming_language.rb
app/models/programming_language.rb
+2
-0
app/models/project_services/asana_service.rb
app/models/project_services/asana_service.rb
+2
-0
app/models/project_services/assembla_service.rb
app/models/project_services/assembla_service.rb
+2
-0
app/models/project_services/bamboo_service.rb
app/models/project_services/bamboo_service.rb
+2
-0
app/models/project_services/bugzilla_service.rb
app/models/project_services/bugzilla_service.rb
+2
-0
app/models/project_services/buildkite_service.rb
app/models/project_services/buildkite_service.rb
+2
-0
app/models/project_services/builds_email_service.rb
app/models/project_services/builds_email_service.rb
+2
-0
app/models/project_services/campfire_service.rb
app/models/project_services/campfire_service.rb
+4
-2
app/models/project_services/chat_message/base_message.rb
app/models/project_services/chat_message/base_message.rb
+2
-0
app/models/project_services/chat_message/issue_message.rb
app/models/project_services/chat_message/issue_message.rb
+2
-0
app/models/project_services/chat_message/merge_message.rb
app/models/project_services/chat_message/merge_message.rb
+2
-0
app/models/project_services/chat_message/note_message.rb
app/models/project_services/chat_message/note_message.rb
+2
-0
app/models/project_services/chat_message/pipeline_message.rb
app/models/project_services/chat_message/pipeline_message.rb
+2
-0
app/models/project_services/chat_message/push_message.rb
app/models/project_services/chat_message/push_message.rb
+2
-0
app/models/project_services/chat_message/wiki_page_message.rb
...models/project_services/chat_message/wiki_page_message.rb
+2
-0
app/models/project_services/chat_notification_service.rb
app/models/project_services/chat_notification_service.rb
+2
-0
app/models/project_services/ci_service.rb
app/models/project_services/ci_service.rb
+2
-0
app/models/project_services/custom_issue_tracker_service.rb
app/models/project_services/custom_issue_tracker_service.rb
+2
-0
app/models/project_services/deployment_service.rb
app/models/project_services/deployment_service.rb
+2
-0
app/models/project_services/drone_ci_service.rb
app/models/project_services/drone_ci_service.rb
+2
-0
app/models/project_services/emails_on_push_service.rb
app/models/project_services/emails_on_push_service.rb
+2
-0
app/models/project_services/external_wiki_service.rb
app/models/project_services/external_wiki_service.rb
+2
-0
app/models/project_services/flowdock_service.rb
app/models/project_services/flowdock_service.rb
+2
-0
app/models/project_services/gemnasium_service.rb
app/models/project_services/gemnasium_service.rb
+2
-0
app/models/project_services/gitlab_issue_tracker_service.rb
app/models/project_services/gitlab_issue_tracker_service.rb
+2
-0
app/models/project_services/hangouts_chat_service.rb
app/models/project_services/hangouts_chat_service.rb
+2
-0
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+11
-11
app/models/project_services/irker_service.rb
app/models/project_services/irker_service.rb
+2
-0
app/models/project_services/issue_tracker_service.rb
app/models/project_services/issue_tracker_service.rb
+2
-0
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+2
-0
app/models/project_services/kubernetes_service.rb
app/models/project_services/kubernetes_service.rb
+2
-0
app/models/project_services/mattermost_service.rb
app/models/project_services/mattermost_service.rb
+2
-0
app/models/project_services/mattermost_slash_commands_service.rb
...els/project_services/mattermost_slash_commands_service.rb
+2
-0
app/models/project_services/microsoft_teams_service.rb
app/models/project_services/microsoft_teams_service.rb
+2
-0
app/models/project_services/mock_ci_service.rb
app/models/project_services/mock_ci_service.rb
+2
-0
app/models/project_services/mock_deployment_service.rb
app/models/project_services/mock_deployment_service.rb
+2
-0
app/models/project_services/mock_monitoring_service.rb
app/models/project_services/mock_monitoring_service.rb
+2
-0
app/models/project_services/monitoring_service.rb
app/models/project_services/monitoring_service.rb
+2
-0
app/models/project_services/packagist_service.rb
app/models/project_services/packagist_service.rb
+2
-0
app/models/project_services/pipelines_email_service.rb
app/models/project_services/pipelines_email_service.rb
+2
-0
app/models/project_services/pivotaltracker_service.rb
app/models/project_services/pivotaltracker_service.rb
+2
-0
app/models/project_services/prometheus_service.rb
app/models/project_services/prometheus_service.rb
+2
-0
app/models/project_services/pushover_service.rb
app/models/project_services/pushover_service.rb
+3
-1
app/models/project_services/redmine_service.rb
app/models/project_services/redmine_service.rb
+2
-0
app/models/project_services/slack_service.rb
app/models/project_services/slack_service.rb
+2
-0
app/models/project_services/slack_slash_commands_service.rb
app/models/project_services/slack_slash_commands_service.rb
+2
-0
app/models/project_services/slash_commands_service.rb
app/models/project_services/slash_commands_service.rb
+2
-0
app/models/project_services/teamcity_service.rb
app/models/project_services/teamcity_service.rb
+2
-0
app/models/protected_branch/merge_access_level.rb
app/models/protected_branch/merge_access_level.rb
+2
-0
app/models/protected_branch/push_access_level.rb
app/models/protected_branch/push_access_level.rb
+2
-0
app/models/protected_tag/create_access_level.rb
app/models/protected_tag/create_access_level.rb
+2
-0
app/models/repository_language.rb
app/models/repository_language.rb
+2
-0
app/models/site_statistic.rb
app/models/site_statistic.rb
+2
-0
app/models/storage/hashed_project.rb
app/models/storage/hashed_project.rb
+2
-0
app/models/storage/legacy_project.rb
app/models/storage/legacy_project.rb
+2
-0
changelogs/unreleased/frozen-string-enable-app-models-even-more-still.yml
...eased/frozen-string-enable-app-models-even-more-still.yml
+5
-0
No files found.
app/models/programming_language.rb
View file @
32af384a
# frozen_string_literal: true
class
ProgrammingLanguage
<
ActiveRecord
::
Base
class
ProgrammingLanguage
<
ActiveRecord
::
Base
validates
:name
,
presence:
true
validates
:name
,
presence:
true
validates
:color
,
allow_blank:
false
,
color:
true
validates
:color
,
allow_blank:
false
,
color:
true
...
...
app/models/project_services/asana_service.rb
View file @
32af384a
# frozen_string_literal: true
require
'asana'
require
'asana'
class
AsanaService
<
Service
class
AsanaService
<
Service
...
...
app/models/project_services/assembla_service.rb
View file @
32af384a
# frozen_string_literal: true
class
AssemblaService
<
Service
class
AssemblaService
<
Service
prop_accessor
:token
,
:subdomain
prop_accessor
:token
,
:subdomain
validates
:token
,
presence:
true
,
if: :activated?
validates
:token
,
presence:
true
,
if: :activated?
...
...
app/models/project_services/bamboo_service.rb
View file @
32af384a
# frozen_string_literal: true
class
BambooService
<
CiService
class
BambooService
<
CiService
include
ReactiveService
include
ReactiveService
...
...
app/models/project_services/bugzilla_service.rb
View file @
32af384a
# frozen_string_literal: true
class
BugzillaService
<
IssueTrackerService
class
BugzillaService
<
IssueTrackerService
validates
:project_url
,
:issues_url
,
:new_issue_url
,
presence:
true
,
public_url:
true
,
if: :activated?
validates
:project_url
,
:issues_url
,
:new_issue_url
,
presence:
true
,
public_url:
true
,
if: :activated?
...
...
app/models/project_services/buildkite_service.rb
View file @
32af384a
# frozen_string_literal: true
require
"addressable/uri"
require
"addressable/uri"
class
BuildkiteService
<
CiService
class
BuildkiteService
<
CiService
...
...
app/models/project_services/builds_email_service.rb
View file @
32af384a
# frozen_string_literal: true
# This class is to be removed with 9.1
# This class is to be removed with 9.1
# We should also by then remove BuildsEmailService from database
# We should also by then remove BuildsEmailService from database
class
BuildsEmailService
<
Service
class
BuildsEmailService
<
Service
...
...
app/models/project_services/campfire_service.rb
View file @
32af384a
# frozen_string_literal: true
class
CampfireService
<
Service
class
CampfireService
<
Service
prop_accessor
:token
,
:subdomain
,
:room
prop_accessor
:token
,
:subdomain
,
:room
validates
:token
,
presence:
true
,
if: :activated?
validates
:token
,
presence:
true
,
if: :activated?
...
@@ -82,7 +84,7 @@ class CampfireService < Service
...
@@ -82,7 +84,7 @@ class CampfireService < Service
before
=
push
[
:before
]
before
=
push
[
:before
]
after
=
push
[
:after
]
after
=
push
[
:after
]
message
=
""
message
=
[]
message
<<
"[
#{
project
.
full_name
}
] "
message
<<
"[
#{
project
.
full_name
}
] "
message
<<
"
#{
push
[
:user_name
]
}
"
message
<<
"
#{
push
[
:user_name
]
}
"
...
@@ -95,6 +97,6 @@ class CampfireService < Service
...
@@ -95,6 +97,6 @@ class CampfireService < Service
message
<<
"
#{
project
.
web_url
}
/compare/
#{
before
}
...
#{
after
}
"
message
<<
"
#{
project
.
web_url
}
/compare/
#{
before
}
...
#{
after
}
"
end
end
message
message
.
join
end
end
end
end
app/models/project_services/chat_message/base_message.rb
View file @
32af384a
# frozen_string_literal: true
require
'slack-notifier'
require
'slack-notifier'
module
ChatMessage
module
ChatMessage
...
...
app/models/project_services/chat_message/issue_message.rb
View file @
32af384a
# frozen_string_literal: true
module
ChatMessage
module
ChatMessage
class
IssueMessage
<
BaseMessage
class
IssueMessage
<
BaseMessage
attr_reader
:title
attr_reader
:title
...
...
app/models/project_services/chat_message/merge_message.rb
View file @
32af384a
# frozen_string_literal: true
module
ChatMessage
module
ChatMessage
class
MergeMessage
<
BaseMessage
class
MergeMessage
<
BaseMessage
attr_reader
:merge_request_iid
attr_reader
:merge_request_iid
...
...
app/models/project_services/chat_message/note_message.rb
View file @
32af384a
# frozen_string_literal: true
module
ChatMessage
module
ChatMessage
class
NoteMessage
<
BaseMessage
class
NoteMessage
<
BaseMessage
attr_reader
:note
attr_reader
:note
...
...
app/models/project_services/chat_message/pipeline_message.rb
View file @
32af384a
# frozen_string_literal: true
module
ChatMessage
module
ChatMessage
class
PipelineMessage
<
BaseMessage
class
PipelineMessage
<
BaseMessage
attr_reader
:ref_type
attr_reader
:ref_type
...
...
app/models/project_services/chat_message/push_message.rb
View file @
32af384a
# frozen_string_literal: true
module
ChatMessage
module
ChatMessage
class
PushMessage
<
BaseMessage
class
PushMessage
<
BaseMessage
attr_reader
:after
attr_reader
:after
...
...
app/models/project_services/chat_message/wiki_page_message.rb
View file @
32af384a
# frozen_string_literal: true
module
ChatMessage
module
ChatMessage
class
WikiPageMessage
<
BaseMessage
class
WikiPageMessage
<
BaseMessage
attr_reader
:title
attr_reader
:title
...
...
app/models/project_services/chat_notification_service.rb
View file @
32af384a
# frozen_string_literal: true
# Base class for Chat notifications services
# Base class for Chat notifications services
# This class is not meant to be used directly, but only to inherit from.
# This class is not meant to be used directly, but only to inherit from.
class
ChatNotificationService
<
Service
class
ChatNotificationService
<
Service
...
...
app/models/project_services/ci_service.rb
View file @
32af384a
# frozen_string_literal: true
# Base class for CI services
# Base class for CI services
# List methods you need to implement to get your CI service
# List methods you need to implement to get your CI service
# working with GitLab Merge Requests
# working with GitLab Merge Requests
...
...
app/models/project_services/custom_issue_tracker_service.rb
View file @
32af384a
# frozen_string_literal: true
class
CustomIssueTrackerService
<
IssueTrackerService
class
CustomIssueTrackerService
<
IssueTrackerService
validates
:project_url
,
:issues_url
,
:new_issue_url
,
presence:
true
,
public_url:
true
,
if: :activated?
validates
:project_url
,
:issues_url
,
:new_issue_url
,
presence:
true
,
public_url:
true
,
if: :activated?
...
...
app/models/project_services/deployment_service.rb
View file @
32af384a
# frozen_string_literal: true
# Base class for deployment services
# Base class for deployment services
#
#
# These services integrate with a deployment solution like Kubernetes/OpenShift,
# These services integrate with a deployment solution like Kubernetes/OpenShift,
...
...
app/models/project_services/drone_ci_service.rb
View file @
32af384a
# frozen_string_literal: true
class
DroneCiService
<
CiService
class
DroneCiService
<
CiService
include
ReactiveService
include
ReactiveService
...
...
app/models/project_services/emails_on_push_service.rb
View file @
32af384a
# frozen_string_literal: true
class
EmailsOnPushService
<
Service
class
EmailsOnPushService
<
Service
boolean_accessor
:send_from_committer_email
boolean_accessor
:send_from_committer_email
boolean_accessor
:disable_diffs
boolean_accessor
:disable_diffs
...
...
app/models/project_services/external_wiki_service.rb
View file @
32af384a
# frozen_string_literal: true
class
ExternalWikiService
<
Service
class
ExternalWikiService
<
Service
prop_accessor
:external_wiki_url
prop_accessor
:external_wiki_url
...
...
app/models/project_services/flowdock_service.rb
View file @
32af384a
# frozen_string_literal: true
require
"flowdock-git-hook"
require
"flowdock-git-hook"
# Flow dock depends on Grit to compute the number of commits between two given
# Flow dock depends on Grit to compute the number of commits between two given
...
...
app/models/project_services/gemnasium_service.rb
View file @
32af384a
# frozen_string_literal: true
require
"gemnasium/gitlab_service"
require
"gemnasium/gitlab_service"
class
GemnasiumService
<
Service
class
GemnasiumService
<
Service
...
...
app/models/project_services/gitlab_issue_tracker_service.rb
View file @
32af384a
# frozen_string_literal: true
class
GitlabIssueTrackerService
<
IssueTrackerService
class
GitlabIssueTrackerService
<
IssueTrackerService
include
Gitlab
::
Routing
include
Gitlab
::
Routing
...
...
app/models/project_services/hangouts_chat_service.rb
View file @
32af384a
# frozen_string_literal: true
require
'hangouts_chat'
require
'hangouts_chat'
class
HangoutsChatService
<
ChatNotificationService
class
HangoutsChatService
<
ChatNotificationService
...
...
app/models/project_services/hipchat_service.rb
View file @
32af384a
# frozen_string_literal: true
class
HipchatService
<
Service
class
HipchatService
<
Service
include
ActionView
::
Helpers
::
SanitizeHelper
include
ActionView
::
Helpers
::
SanitizeHelper
...
@@ -108,7 +110,7 @@ class HipchatService < Service
...
@@ -108,7 +110,7 @@ class HipchatService < Service
before
=
push
[
:before
]
before
=
push
[
:before
]
after
=
push
[
:after
]
after
=
push
[
:after
]
message
=
""
message
=
[]
message
<<
"
#{
push
[
:user_name
]
}
"
message
<<
"
#{
push
[
:user_name
]
}
"
if
Gitlab
::
Git
.
blank_ref?
(
before
)
if
Gitlab
::
Git
.
blank_ref?
(
before
)
...
@@ -132,7 +134,7 @@ class HipchatService < Service
...
@@ -132,7 +134,7 @@ class HipchatService < Service
end
end
end
end
message
message
.
join
end
end
def
markdown
(
text
,
options
=
{})
def
markdown
(
text
,
options
=
{})
...
@@ -165,11 +167,11 @@ class HipchatService < Service
...
@@ -165,11 +167,11 @@ class HipchatService < Service
description
=
obj_attr
[
:description
]
description
=
obj_attr
[
:description
]
issue_link
=
"<a href=
\"
#{
issue_url
}
\"
>issue #
#{
issue_iid
}
</a>"
issue_link
=
"<a href=
\"
#{
issue_url
}
\"
>issue #
#{
issue_iid
}
</a>"
message
=
"
#{
user_name
}
#{
state
}
#{
issue_link
}
in
#{
project_link
}
: <b>
#{
title
}
</b>"
message
=
[
"
#{
user_name
}
#{
state
}
#{
issue_link
}
in
#{
project_link
}
: <b>
#{
title
}
</b>"
]
message
<<
"<pre>
#{
markdown
(
description
)
}
</pre>"
message
<<
"<pre>
#{
markdown
(
description
)
}
</pre>"
message
message
.
join
end
end
def
create_merge_request_message
(
data
)
def
create_merge_request_message
(
data
)
...
@@ -184,12 +186,11 @@ class HipchatService < Service
...
@@ -184,12 +186,11 @@ class HipchatService < Service
merge_request_url
=
"
#{
project_url
}
/merge_requests/
#{
merge_request_id
}
"
merge_request_url
=
"
#{
project_url
}
/merge_requests/
#{
merge_request_id
}
"
merge_request_link
=
"<a href=
\"
#{
merge_request_url
}
\"
>merge request !
#{
merge_request_id
}
</a>"
merge_request_link
=
"<a href=
\"
#{
merge_request_url
}
\"
>merge request !
#{
merge_request_id
}
</a>"
message
=
"
#{
user_name
}
#{
state
}
#{
merge_request_link
}
in "
\
message
=
[
"
#{
user_name
}
#{
state
}
#{
merge_request_link
}
in "
\
"
#{
project_link
}
: <b>
#{
title
}
</b>"
"
#{
project_link
}
: <b>
#{
title
}
</b>"
]
message
<<
"<pre>
#{
markdown
(
description
)
}
</pre>"
message
<<
"<pre>
#{
markdown
(
description
)
}
</pre>"
message
.
join
message
end
end
def
format_title
(
title
)
def
format_title
(
title
)
...
@@ -235,12 +236,11 @@ class HipchatService < Service
...
@@ -235,12 +236,11 @@ class HipchatService < Service
end
end
subject_html
=
"<a href=
\"
#{
note_url
}
\"
>
#{
subject_type
}
#{
subject_desc
}
</a>"
subject_html
=
"<a href=
\"
#{
note_url
}
\"
>
#{
subject_type
}
#{
subject_desc
}
</a>"
message
=
"
#{
user_name
}
commented on
#{
subject_html
}
in
#{
project_link
}
: "
message
=
[
"
#{
user_name
}
commented on
#{
subject_html
}
in
#{
project_link
}
: "
]
message
<<
title
message
<<
title
message
<<
"<pre>
#{
markdown
(
note
,
ref:
commit_id
)
}
</pre>"
message
<<
"<pre>
#{
markdown
(
note
,
ref:
commit_id
)
}
</pre>"
message
.
join
message
end
end
def
create_pipeline_message
(
data
)
def
create_pipeline_message
(
data
)
...
...
app/models/project_services/irker_service.rb
View file @
32af384a
# frozen_string_literal: true
require
'uri'
require
'uri'
class
IrkerService
<
Service
class
IrkerService
<
Service
...
...
app/models/project_services/issue_tracker_service.rb
View file @
32af384a
# frozen_string_literal: true
class
IssueTrackerService
<
Service
class
IssueTrackerService
<
Service
validate
:one_issue_tracker
,
if: :activated?
,
on: :manual_change
validate
:one_issue_tracker
,
if: :activated?
,
on: :manual_change
...
...
app/models/project_services/jira_service.rb
View file @
32af384a
# frozen_string_literal: true
class
JiraService
<
IssueTrackerService
class
JiraService
<
IssueTrackerService
include
Gitlab
::
Routing
include
Gitlab
::
Routing
include
ApplicationHelper
include
ApplicationHelper
...
...
app/models/project_services/kubernetes_service.rb
View file @
32af384a
# frozen_string_literal: true
##
##
# NOTE:
# NOTE:
# We'll move this class to Clusters::Platforms::Kubernetes, which contains exactly the same logic.
# We'll move this class to Clusters::Platforms::Kubernetes, which contains exactly the same logic.
...
...
app/models/project_services/mattermost_service.rb
View file @
32af384a
# frozen_string_literal: true
class
MattermostService
<
ChatNotificationService
class
MattermostService
<
ChatNotificationService
def
title
def
title
'Mattermost notifications'
'Mattermost notifications'
...
...
app/models/project_services/mattermost_slash_commands_service.rb
View file @
32af384a
# frozen_string_literal: true
class
MattermostSlashCommandsService
<
SlashCommandsService
class
MattermostSlashCommandsService
<
SlashCommandsService
include
TriggersHelper
include
TriggersHelper
...
...
app/models/project_services/microsoft_teams_service.rb
View file @
32af384a
# frozen_string_literal: true
class
MicrosoftTeamsService
<
ChatNotificationService
class
MicrosoftTeamsService
<
ChatNotificationService
def
title
def
title
'Microsoft Teams Notification'
'Microsoft Teams Notification'
...
...
app/models/project_services/mock_ci_service.rb
View file @
32af384a
# frozen_string_literal: true
# For an example companion mocking service, see https://gitlab.com/gitlab-org/gitlab-mock-ci-service
# For an example companion mocking service, see https://gitlab.com/gitlab-org/gitlab-mock-ci-service
class
MockCiService
<
CiService
class
MockCiService
<
CiService
ALLOWED_STATES
=
%w[failed canceled running pending success success_with_warnings skipped not_found]
.
freeze
ALLOWED_STATES
=
%w[failed canceled running pending success success_with_warnings skipped not_found]
.
freeze
...
...
app/models/project_services/mock_deployment_service.rb
View file @
32af384a
# frozen_string_literal: true
class
MockDeploymentService
<
DeploymentService
class
MockDeploymentService
<
DeploymentService
def
title
def
title
'Mock deployment'
'Mock deployment'
...
...
app/models/project_services/mock_monitoring_service.rb
View file @
32af384a
# frozen_string_literal: true
class
MockMonitoringService
<
MonitoringService
class
MockMonitoringService
<
MonitoringService
def
title
def
title
'Mock monitoring'
'Mock monitoring'
...
...
app/models/project_services/monitoring_service.rb
View file @
32af384a
# frozen_string_literal: true
# Base class for monitoring services
# Base class for monitoring services
#
#
# These services integrate with a deployment solution like Prometheus
# These services integrate with a deployment solution like Prometheus
...
...
app/models/project_services/packagist_service.rb
View file @
32af384a
# frozen_string_literal: true
class
PackagistService
<
Service
class
PackagistService
<
Service
prop_accessor
:username
,
:token
,
:server
prop_accessor
:username
,
:token
,
:server
...
...
app/models/project_services/pipelines_email_service.rb
View file @
32af384a
# frozen_string_literal: true
class
PipelinesEmailService
<
Service
class
PipelinesEmailService
<
Service
prop_accessor
:recipients
prop_accessor
:recipients
boolean_accessor
:notify_only_broken_pipelines
boolean_accessor
:notify_only_broken_pipelines
...
...
app/models/project_services/pivotaltracker_service.rb
View file @
32af384a
# frozen_string_literal: true
class
PivotaltrackerService
<
Service
class
PivotaltrackerService
<
Service
API_ENDPOINT
=
'https://www.pivotaltracker.com/services/v5/source_commits'
.
freeze
API_ENDPOINT
=
'https://www.pivotaltracker.com/services/v5/source_commits'
.
freeze
...
...
app/models/project_services/prometheus_service.rb
View file @
32af384a
# frozen_string_literal: true
class
PrometheusService
<
MonitoringService
class
PrometheusService
<
MonitoringService
include
PrometheusAdapter
include
PrometheusAdapter
...
...
app/models/project_services/pushover_service.rb
View file @
32af384a
# frozen_string_literal: true
class
PushoverService
<
Service
class
PushoverService
<
Service
BASE_URI
=
'https://api.pushover.net/1'
.
freeze
BASE_URI
=
'https://api.pushover.net/1'
.
freeze
...
@@ -79,7 +81,7 @@ class PushoverService < Service
...
@@ -79,7 +81,7 @@ class PushoverService < Service
end
end
if
data
[
:total_commits_count
]
>
0
if
data
[
:total_commits_count
]
>
0
message
<<
"
\n
Total commits count:
#{
data
[
:total_commits_count
]
}
"
message
=
[
message
,
"Total commits count:
#{
data
[
:total_commits_count
]
}
"
].
join
(
"
\n
"
)
end
end
pushover_data
=
{
pushover_data
=
{
...
...
app/models/project_services/redmine_service.rb
View file @
32af384a
# frozen_string_literal: true
class
RedmineService
<
IssueTrackerService
class
RedmineService
<
IssueTrackerService
validates
:project_url
,
:issues_url
,
:new_issue_url
,
presence:
true
,
public_url:
true
,
if: :activated?
validates
:project_url
,
:issues_url
,
:new_issue_url
,
presence:
true
,
public_url:
true
,
if: :activated?
...
...
app/models/project_services/slack_service.rb
View file @
32af384a
# frozen_string_literal: true
class
SlackService
<
ChatNotificationService
class
SlackService
<
ChatNotificationService
def
title
def
title
'Slack notifications'
'Slack notifications'
...
...
app/models/project_services/slack_slash_commands_service.rb
View file @
32af384a
# frozen_string_literal: true
class
SlackSlashCommandsService
<
SlashCommandsService
class
SlackSlashCommandsService
<
SlashCommandsService
include
TriggersHelper
include
TriggersHelper
...
...
app/models/project_services/slash_commands_service.rb
View file @
32af384a
# frozen_string_literal: true
# Base class for Chat services
# Base class for Chat services
# This class is not meant to be used directly, but only to inherrit from.
# This class is not meant to be used directly, but only to inherrit from.
class
SlashCommandsService
<
Service
class
SlashCommandsService
<
Service
...
...
app/models/project_services/teamcity_service.rb
View file @
32af384a
# frozen_string_literal: true
class
TeamcityService
<
CiService
class
TeamcityService
<
CiService
include
ReactiveService
include
ReactiveService
...
...
app/models/protected_branch/merge_access_level.rb
View file @
32af384a
# frozen_string_literal: true
class
ProtectedBranch::MergeAccessLevel
<
ActiveRecord
::
Base
class
ProtectedBranch::MergeAccessLevel
<
ActiveRecord
::
Base
include
ProtectedBranchAccess
include
ProtectedBranchAccess
end
end
app/models/protected_branch/push_access_level.rb
View file @
32af384a
# frozen_string_literal: true
class
ProtectedBranch::PushAccessLevel
<
ActiveRecord
::
Base
class
ProtectedBranch::PushAccessLevel
<
ActiveRecord
::
Base
include
ProtectedBranchAccess
include
ProtectedBranchAccess
end
end
app/models/protected_tag/create_access_level.rb
View file @
32af384a
# frozen_string_literal: true
class
ProtectedTag::CreateAccessLevel
<
ActiveRecord
::
Base
class
ProtectedTag::CreateAccessLevel
<
ActiveRecord
::
Base
include
ProtectedTagAccess
include
ProtectedTagAccess
...
...
app/models/repository_language.rb
View file @
32af384a
# frozen_string_literal: true
class
RepositoryLanguage
<
ActiveRecord
::
Base
class
RepositoryLanguage
<
ActiveRecord
::
Base
belongs_to
:project
belongs_to
:project
belongs_to
:programming_language
belongs_to
:programming_language
...
...
app/models/site_statistic.rb
View file @
32af384a
# frozen_string_literal: true
class
SiteStatistic
<
ActiveRecord
::
Base
class
SiteStatistic
<
ActiveRecord
::
Base
# prevents the creation of multiple rows
# prevents the creation of multiple rows
default_value_for
:id
,
1
default_value_for
:id
,
1
...
...
app/models/storage/hashed_project.rb
View file @
32af384a
# frozen_string_literal: true
module
Storage
module
Storage
class
HashedProject
class
HashedProject
attr_accessor
:project
attr_accessor
:project
...
...
app/models/storage/legacy_project.rb
View file @
32af384a
# frozen_string_literal: true
module
Storage
module
Storage
class
LegacyProject
class
LegacyProject
attr_accessor
:project
attr_accessor
:project
...
...
changelogs/unreleased/frozen-string-enable-app-models-even-more-still.yml
0 → 100644
View file @
32af384a
---
title
:
Enable frozen string in rest of app/models/**/*.rb
merge_request
:
gfyoung
author
:
type
:
performance
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