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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
dce26700
Commit
dce26700
authored
Jul 19, 2018
by
gfyoung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen string in app/serializers/**/*.rb
Partially addresses #47424.
parent
e23b966d
Changes
100
Hide whitespace changes
Inline
Side-by-side
Showing
100 changed files
with
216 additions
and
8 deletions
+216
-8
app/serializers/analytics_build_entity.rb
app/serializers/analytics_build_entity.rb
+2
-0
app/serializers/analytics_build_serializer.rb
app/serializers/analytics_build_serializer.rb
+2
-0
app/serializers/analytics_commit_entity.rb
app/serializers/analytics_commit_entity.rb
+2
-0
app/serializers/analytics_commit_serializer.rb
app/serializers/analytics_commit_serializer.rb
+2
-0
app/serializers/analytics_generic_serializer.rb
app/serializers/analytics_generic_serializer.rb
+2
-0
app/serializers/analytics_issue_entity.rb
app/serializers/analytics_issue_entity.rb
+2
-0
app/serializers/analytics_issue_serializer.rb
app/serializers/analytics_issue_serializer.rb
+2
-0
app/serializers/analytics_merge_request_entity.rb
app/serializers/analytics_merge_request_entity.rb
+2
-0
app/serializers/analytics_merge_request_serializer.rb
app/serializers/analytics_merge_request_serializer.rb
+2
-0
app/serializers/analytics_stage_entity.rb
app/serializers/analytics_stage_entity.rb
+2
-0
app/serializers/analytics_stage_serializer.rb
app/serializers/analytics_stage_serializer.rb
+2
-0
app/serializers/analytics_summary_entity.rb
app/serializers/analytics_summary_entity.rb
+2
-0
app/serializers/analytics_summary_serializer.rb
app/serializers/analytics_summary_serializer.rb
+2
-0
app/serializers/award_emoji_entity.rb
app/serializers/award_emoji_entity.rb
+2
-0
app/serializers/base_serializer.rb
app/serializers/base_serializer.rb
+2
-0
app/serializers/blob_entity.rb
app/serializers/blob_entity.rb
+2
-0
app/serializers/build_action_entity.rb
app/serializers/build_action_entity.rb
+2
-0
app/serializers/build_artifact_entity.rb
app/serializers/build_artifact_entity.rb
+2
-0
app/serializers/build_details_entity.rb
app/serializers/build_details_entity.rb
+2
-0
app/serializers/build_metadata_entity.rb
app/serializers/build_metadata_entity.rb
+2
-0
app/serializers/build_serializer.rb
app/serializers/build_serializer.rb
+2
-0
app/serializers/cluster_application_entity.rb
app/serializers/cluster_application_entity.rb
+2
-0
app/serializers/cluster_entity.rb
app/serializers/cluster_entity.rb
+2
-0
app/serializers/cluster_serializer.rb
app/serializers/cluster_serializer.rb
+2
-0
app/serializers/cohort_activity_month_entity.rb
app/serializers/cohort_activity_month_entity.rb
+2
-0
app/serializers/cohort_entity.rb
app/serializers/cohort_entity.rb
+2
-0
app/serializers/cohorts_entity.rb
app/serializers/cohorts_entity.rb
+2
-0
app/serializers/cohorts_serializer.rb
app/serializers/cohorts_serializer.rb
+2
-0
app/serializers/commit_entity.rb
app/serializers/commit_entity.rb
+2
-0
app/serializers/concerns/with_pagination.rb
app/serializers/concerns/with_pagination.rb
+2
-0
app/serializers/container_repositories_serializer.rb
app/serializers/container_repositories_serializer.rb
+2
-0
app/serializers/container_repository_entity.rb
app/serializers/container_repository_entity.rb
+2
-0
app/serializers/container_tag_entity.rb
app/serializers/container_tag_entity.rb
+2
-0
app/serializers/container_tags_serializer.rb
app/serializers/container_tags_serializer.rb
+2
-0
app/serializers/deploy_key_entity.rb
app/serializers/deploy_key_entity.rb
+2
-0
app/serializers/deploy_key_serializer.rb
app/serializers/deploy_key_serializer.rb
+2
-0
app/serializers/deploy_keys_project_entity.rb
app/serializers/deploy_keys_project_entity.rb
+2
-0
app/serializers/deployment_entity.rb
app/serializers/deployment_entity.rb
+2
-0
app/serializers/deployment_serializer.rb
app/serializers/deployment_serializer.rb
+2
-0
app/serializers/diff_file_entity.rb
app/serializers/diff_file_entity.rb
+2
-0
app/serializers/diffs_entity.rb
app/serializers/diffs_entity.rb
+2
-0
app/serializers/diffs_serializer.rb
app/serializers/diffs_serializer.rb
+2
-0
app/serializers/discussion_entity.rb
app/serializers/discussion_entity.rb
+2
-0
app/serializers/discussion_serializer.rb
app/serializers/discussion_serializer.rb
+2
-0
app/serializers/entity_date_helper.rb
app/serializers/entity_date_helper.rb
+15
-8
app/serializers/entity_request.rb
app/serializers/entity_request.rb
+2
-0
app/serializers/environment_entity.rb
app/serializers/environment_entity.rb
+2
-0
app/serializers/environment_serializer.rb
app/serializers/environment_serializer.rb
+2
-0
app/serializers/group_child_entity.rb
app/serializers/group_child_entity.rb
+2
-0
app/serializers/group_child_serializer.rb
app/serializers/group_child_serializer.rb
+2
-0
app/serializers/group_entity.rb
app/serializers/group_entity.rb
+2
-0
app/serializers/group_serializer.rb
app/serializers/group_serializer.rb
+2
-0
app/serializers/group_variable_entity.rb
app/serializers/group_variable_entity.rb
+2
-0
app/serializers/group_variable_serializer.rb
app/serializers/group_variable_serializer.rb
+2
-0
app/serializers/issuable_entity.rb
app/serializers/issuable_entity.rb
+2
-0
app/serializers/issuable_sidebar_entity.rb
app/serializers/issuable_sidebar_entity.rb
+2
-0
app/serializers/issue_entity.rb
app/serializers/issue_entity.rb
+2
-0
app/serializers/issue_serializer.rb
app/serializers/issue_serializer.rb
+2
-0
app/serializers/issue_sidebar_entity.rb
app/serializers/issue_sidebar_entity.rb
+2
-0
app/serializers/job_entity.rb
app/serializers/job_entity.rb
+2
-0
app/serializers/job_group_entity.rb
app/serializers/job_group_entity.rb
+2
-0
app/serializers/label_entity.rb
app/serializers/label_entity.rb
+2
-0
app/serializers/label_serializer.rb
app/serializers/label_serializer.rb
+2
-0
app/serializers/lfs_file_lock_entity.rb
app/serializers/lfs_file_lock_entity.rb
+2
-0
app/serializers/lfs_file_lock_serializer.rb
app/serializers/lfs_file_lock_serializer.rb
+2
-0
app/serializers/merge_request_basic_entity.rb
app/serializers/merge_request_basic_entity.rb
+2
-0
app/serializers/merge_request_basic_serializer.rb
app/serializers/merge_request_basic_serializer.rb
+2
-0
app/serializers/merge_request_create_entity.rb
app/serializers/merge_request_create_entity.rb
+2
-0
app/serializers/merge_request_create_serializer.rb
app/serializers/merge_request_create_serializer.rb
+2
-0
app/serializers/merge_request_diff_entity.rb
app/serializers/merge_request_diff_entity.rb
+2
-0
app/serializers/merge_request_metrics_entity.rb
app/serializers/merge_request_metrics_entity.rb
+2
-0
app/serializers/merge_request_serializer.rb
app/serializers/merge_request_serializer.rb
+2
-0
app/serializers/merge_request_user_entity.rb
app/serializers/merge_request_user_entity.rb
+2
-0
app/serializers/merge_request_widget_entity.rb
app/serializers/merge_request_widget_entity.rb
+2
-0
app/serializers/note_attachment_entity.rb
app/serializers/note_attachment_entity.rb
+2
-0
app/serializers/note_entity.rb
app/serializers/note_entity.rb
+2
-0
app/serializers/note_user_entity.rb
app/serializers/note_user_entity.rb
+2
-0
app/serializers/pipeline_details_entity.rb
app/serializers/pipeline_details_entity.rb
+2
-0
app/serializers/pipeline_entity.rb
app/serializers/pipeline_entity.rb
+2
-0
app/serializers/pipeline_serializer.rb
app/serializers/pipeline_serializer.rb
+2
-0
app/serializers/project_entity.rb
app/serializers/project_entity.rb
+2
-0
app/serializers/project_mirror_entity.rb
app/serializers/project_mirror_entity.rb
+2
-0
app/serializers/project_note_entity.rb
app/serializers/project_note_entity.rb
+2
-0
app/serializers/project_note_serializer.rb
app/serializers/project_note_serializer.rb
+2
-0
app/serializers/project_serializer.rb
app/serializers/project_serializer.rb
+2
-0
app/serializers/request_aware_entity.rb
app/serializers/request_aware_entity.rb
+2
-0
app/serializers/runner_entity.rb
app/serializers/runner_entity.rb
+2
-0
app/serializers/stage_entity.rb
app/serializers/stage_entity.rb
+2
-0
app/serializers/stage_serializer.rb
app/serializers/stage_serializer.rb
+2
-0
app/serializers/status_entity.rb
app/serializers/status_entity.rb
+2
-0
app/serializers/submodule_entity.rb
app/serializers/submodule_entity.rb
+2
-0
app/serializers/time_trackable_entity.rb
app/serializers/time_trackable_entity.rb
+2
-0
app/serializers/tree_entity.rb
app/serializers/tree_entity.rb
+2
-0
app/serializers/tree_root_entity.rb
app/serializers/tree_root_entity.rb
+2
-0
app/serializers/tree_serializer.rb
app/serializers/tree_serializer.rb
+2
-0
app/serializers/user_entity.rb
app/serializers/user_entity.rb
+2
-0
app/serializers/user_serializer.rb
app/serializers/user_serializer.rb
+2
-0
app/serializers/variable_entity.rb
app/serializers/variable_entity.rb
+2
-0
app/serializers/variable_serializer.rb
app/serializers/variable_serializer.rb
+2
-0
changelogs/unreleased/frozen-string-enable-app-serializers.yml
...elogs/unreleased/frozen-string-enable-app-serializers.yml
+5
-0
No files found.
app/serializers/analytics_build_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsBuildEntity
<
Grape
::
Entity
include
RequestAwareEntity
include
EntityDateHelper
...
...
app/serializers/analytics_build_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsBuildSerializer
<
BaseSerializer
entity
AnalyticsBuildEntity
end
app/serializers/analytics_commit_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsCommitEntity
<
CommitEntity
include
EntityDateHelper
...
...
app/serializers/analytics_commit_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsCommitSerializer
<
BaseSerializer
entity
AnalyticsCommitEntity
end
app/serializers/analytics_generic_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsGenericSerializer
<
BaseSerializer
def
represent
(
resource
,
opts
=
{})
resource
.
symbolize_keys!
...
...
app/serializers/analytics_issue_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsIssueEntity
<
Grape
::
Entity
include
RequestAwareEntity
include
EntityDateHelper
...
...
app/serializers/analytics_issue_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsIssueSerializer
<
AnalyticsGenericSerializer
entity
AnalyticsIssueEntity
end
app/serializers/analytics_merge_request_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsMergeRequestEntity
<
AnalyticsIssueEntity
expose
:state
...
...
app/serializers/analytics_merge_request_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsMergeRequestSerializer
<
AnalyticsGenericSerializer
entity
AnalyticsMergeRequestEntity
end
app/serializers/analytics_stage_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsStageEntity
<
Grape
::
Entity
include
EntityDateHelper
...
...
app/serializers/analytics_stage_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsStageSerializer
<
BaseSerializer
entity
AnalyticsStageEntity
end
app/serializers/analytics_summary_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsSummaryEntity
<
Grape
::
Entity
expose
:value
,
safe:
true
expose
:title
...
...
app/serializers/analytics_summary_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
AnalyticsSummarySerializer
<
BaseSerializer
entity
AnalyticsSummaryEntity
end
app/serializers/award_emoji_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
AwardEmojiEntity
<
Grape
::
Entity
expose
:name
expose
:user
,
using:
API
::
Entities
::
UserSafe
...
...
app/serializers/base_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
BaseSerializer
attr_reader
:params
...
...
app/serializers/blob_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
BlobEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/build_action_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
BuildActionEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/build_artifact_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
BuildArtifactEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/build_details_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
BuildDetailsEntity
<
JobEntity
expose
:coverage
,
:erased_at
,
:duration
expose
:tag_list
,
as: :tags
...
...
app/serializers/build_metadata_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
BuildMetadataEntity
<
Grape
::
Entity
expose
:timeout_human_readable
expose
:timeout_source
do
|
metadata
|
...
...
app/serializers/build_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
BuildSerializer
<
BaseSerializer
entity
JobEntity
...
...
app/serializers/cluster_application_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
ClusterApplicationEntity
<
Grape
::
Entity
expose
:name
expose
:status_name
,
as: :status
...
...
app/serializers/cluster_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
ClusterEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/cluster_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
ClusterSerializer
<
BaseSerializer
entity
ClusterEntity
...
...
app/serializers/cohort_activity_month_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
CohortActivityMonthEntity
<
Grape
::
Entity
include
ActionView
::
Helpers
::
NumberHelper
...
...
app/serializers/cohort_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
CohortEntity
<
Grape
::
Entity
include
ActionView
::
Helpers
::
NumberHelper
...
...
app/serializers/cohorts_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
CohortsEntity
<
Grape
::
Entity
expose
:months_included
expose
:cohorts
,
using:
CohortEntity
...
...
app/serializers/cohorts_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
CohortsSerializer
<
AnalyticsGenericSerializer
entity
CohortsEntity
end
app/serializers/commit_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
CommitEntity
<
API
::
Entities
::
Commit
include
RequestAwareEntity
...
...
app/serializers/concerns/with_pagination.rb
View file @
dce26700
# frozen_string_literal: true
module
WithPagination
attr_accessor
:paginator
...
...
app/serializers/container_repositories_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
ContainerRepositoriesSerializer
<
BaseSerializer
entity
ContainerRepositoryEntity
end
app/serializers/container_repository_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
ContainerRepositoryEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/container_tag_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
ContainerTagEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/container_tags_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
ContainerTagsSerializer
<
BaseSerializer
entity
ContainerTagEntity
...
...
app/serializers/deploy_key_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
DeployKeyEntity
<
Grape
::
Entity
expose
:id
expose
:user_id
...
...
app/serializers/deploy_key_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
DeployKeySerializer
<
BaseSerializer
entity
DeployKeyEntity
end
app/serializers/deploy_keys_project_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
DeployKeysProjectEntity
<
Grape
::
Entity
expose
:can_push
expose
:project
,
using:
ProjectEntity
...
...
app/serializers/deployment_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
DeploymentEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/deployment_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
DeploymentSerializer
<
BaseSerializer
entity
DeploymentEntity
...
...
app/serializers/diff_file_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
DiffFileEntity
<
Grape
::
Entity
include
RequestAwareEntity
include
BlobHelper
...
...
app/serializers/diffs_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
DiffsEntity
<
Grape
::
Entity
include
DiffHelper
include
RequestAwareEntity
...
...
app/serializers/diffs_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
DiffsSerializer
<
BaseSerializer
entity
DiffsEntity
end
app/serializers/discussion_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
DiscussionEntity
<
Grape
::
Entity
include
RequestAwareEntity
include
NotesHelper
...
...
app/serializers/discussion_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
DiscussionSerializer
<
BaseSerializer
entity
DiscussionEntity
end
app/serializers/entity_date_helper.rb
View file @
dce26700
# frozen_string_literal: true
module
EntityDateHelper
include
ActionView
::
Helpers
::
DateHelper
include
ActionView
::
Helpers
::
TagHelper
...
...
@@ -50,15 +52,20 @@ module EntityDateHelper
elsif
entity
.
due_date
is_upcoming
=
(
entity
.
due_date
-
Date
.
today
).
to_i
>
0
time_ago
=
time_ago_in_words
(
entity
.
due_date
)
content
=
time_ago
.
gsub
(
/\d+/
)
{
|
match
|
"<strong>
#{
match
}
</strong>"
}
content
.
slice!
(
"about "
)
content
<<
" "
+
(
is_upcoming
?
_
(
"remaining"
)
:
_
(
"ago"
))
content
.
html_safe
# https://gitlab.com/gitlab-org/gitlab-ce/issues/49440
#
# Need to improve the i18n here and do a full translation
# of the string instead of piecewise translations.
content
=
time_ago
.
gsub
(
/\d+/
)
{
|
match
|
"<strong>
#{
match
}
</strong>"
}
.
remove
(
"about "
)
remaining_or_ago
=
is_upcoming
?
_
(
"remaining"
)
:
_
(
"ago"
)
"
#{
content
}
#{
remaining_or_ago
}
"
.
html_safe
elsif
entity
.
start_date
&&
entity
.
start_date
.
past?
days
=
entity
.
elapsed_days
content
=
content_tag
(
:strong
,
days
)
content
<<
"
#{
'day'
.
pluralize
(
days
)
}
elapsed"
content
.
html_safe
days
=
entity
.
elapsed_days
"
#{
content_tag
(
:strong
,
days
)
}
#{
'day'
.
pluralize
(
days
)
}
elapsed"
.
html_safe
end
end
end
app/serializers/entity_request.rb
View file @
dce26700
# frozen_string_literal: true
class
EntityRequest
# We use EntityRequest object to collect parameters and variables
# from the controller. Because options that are being passed to the entity
...
...
app/serializers/environment_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
EnvironmentEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/environment_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
EnvironmentSerializer
<
BaseSerializer
include
WithPagination
...
...
app/serializers/group_child_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
GroupChildEntity
<
Grape
::
Entity
include
ActionView
::
Helpers
::
NumberHelper
include
RequestAwareEntity
...
...
app/serializers/group_child_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
GroupChildSerializer
<
BaseSerializer
include
WithPagination
...
...
app/serializers/group_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
GroupEntity
<
Grape
::
Entity
include
ActionView
::
Helpers
::
NumberHelper
include
RequestAwareEntity
...
...
app/serializers/group_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
GroupSerializer
<
BaseSerializer
include
WithPagination
...
...
app/serializers/group_variable_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
GroupVariableEntity
<
Grape
::
Entity
expose
:id
expose
:key
...
...
app/serializers/group_variable_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
GroupVariableSerializer
<
BaseSerializer
entity
GroupVariableEntity
end
app/serializers/issuable_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
IssuableEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/issuable_sidebar_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
IssuableSidebarEntity
<
Grape
::
Entity
include
TimeTrackableEntity
include
RequestAwareEntity
...
...
app/serializers/issue_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
IssueEntity
<
IssuableEntity
include
TimeTrackableEntity
...
...
app/serializers/issue_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
IssueSerializer
<
BaseSerializer
# This overrided method takes care of which entity should be used
# to serialize the `issue` based on `basic` key in `opts` param.
...
...
app/serializers/issue_sidebar_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
IssueSidebarEntity
<
IssuableSidebarEntity
expose
:assignees
,
using:
API
::
Entities
::
UserBasic
end
app/serializers/job_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
JobEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/job_group_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
JobGroupEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/label_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
LabelEntity
<
Grape
::
Entity
expose
:id
,
if:
->
(
label
,
_
)
{
!
label
.
is_a?
(
GlobalLabel
)
}
...
...
app/serializers/label_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
LabelSerializer
<
BaseSerializer
entity
LabelEntity
...
...
app/serializers/lfs_file_lock_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
LfsFileLockEntity
<
Grape
::
Entity
root
'locks'
,
'lock'
...
...
app/serializers/lfs_file_lock_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
LfsFileLockSerializer
<
BaseSerializer
entity
LfsFileLockEntity
end
app/serializers/merge_request_basic_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestBasicEntity
<
IssuableSidebarEntity
expose
:assignee_id
expose
:merge_status
...
...
app/serializers/merge_request_basic_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestBasicSerializer
<
BaseSerializer
entity
MergeRequestBasicEntity
end
app/serializers/merge_request_create_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestCreateEntity
<
Grape
::
Entity
expose
:iid
...
...
app/serializers/merge_request_create_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestCreateSerializer
<
BaseSerializer
entity
MergeRequestCreateEntity
end
app/serializers/merge_request_diff_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestDiffEntity
<
Grape
::
Entity
include
Gitlab
::
Routing
include
GitHelper
...
...
app/serializers/merge_request_metrics_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestMetricsEntity
<
Grape
::
Entity
expose
:latest_closed_at
,
as: :closed_at
expose
:merged_at
...
...
app/serializers/merge_request_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestSerializer
<
BaseSerializer
# This overrided method takes care of which entity should be used
# to serialize the `merge_request` based on `serializer` key in `opts` param.
...
...
app/serializers/merge_request_user_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestUserEntity
<
UserEntity
include
RequestAwareEntity
include
BlobHelper
...
...
app/serializers/merge_request_widget_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
MergeRequestWidgetEntity
<
IssuableEntity
expose
:state
expose
:in_progress_merge_commit_sha
...
...
app/serializers/note_attachment_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
NoteAttachmentEntity
<
Grape
::
Entity
expose
:url
expose
:filename
...
...
app/serializers/note_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
NoteEntity
<
API
::
Entities
::
Note
include
RequestAwareEntity
include
NotesHelper
...
...
app/serializers/note_user_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
NoteUserEntity
<
UserEntity
unexpose
:web_url
end
app/serializers/pipeline_details_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
PipelineDetailsEntity
<
PipelineEntity
expose
:details
do
expose
:ordered_stages
,
as: :stages
,
using:
StageEntity
...
...
app/serializers/pipeline_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
PipelineEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/pipeline_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
PipelineSerializer
<
BaseSerializer
include
WithPagination
entity
PipelineDetailsEntity
...
...
app/serializers/project_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
ProjectEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/project_mirror_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
ProjectMirrorEntity
<
Grape
::
Entity
expose
:id
...
...
app/serializers/project_note_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
ProjectNoteEntity
<
NoteEntity
expose
:human_access
do
|
note
|
note
.
project
.
team
.
human_max_access
(
note
.
author_id
)
...
...
app/serializers/project_note_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
ProjectNoteSerializer
<
BaseSerializer
entity
ProjectNoteEntity
end
app/serializers/project_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
ProjectSerializer
<
BaseSerializer
entity
ProjectEntity
end
app/serializers/request_aware_entity.rb
View file @
dce26700
# frozen_string_literal: true
module
RequestAwareEntity
extend
ActiveSupport
::
Concern
...
...
app/serializers/runner_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
RunnerEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/stage_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
StageEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/stage_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
StageSerializer
<
BaseSerializer
include
WithPagination
...
...
app/serializers/status_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
StatusEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/submodule_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
SubmoduleEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/time_trackable_entity.rb
View file @
dce26700
# frozen_string_literal: true
module
TimeTrackableEntity
extend
ActiveSupport
::
Concern
extend
Grape
...
...
app/serializers/tree_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
TreeEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/tree_root_entity.rb
View file @
dce26700
# frozen_string_literal: true
# TODO: Inherit from TreeEntity, when `Tree` implements `id` and `name` like `Gitlab::Git::Tree`.
class
TreeRootEntity
<
Grape
::
Entity
include
RequestAwareEntity
...
...
app/serializers/tree_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
TreeSerializer
<
BaseSerializer
entity
TreeRootEntity
end
app/serializers/user_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
UserEntity
<
API
::
Entities
::
UserBasic
include
RequestAwareEntity
...
...
app/serializers/user_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
UserSerializer
<
BaseSerializer
entity
UserEntity
end
app/serializers/variable_entity.rb
View file @
dce26700
# frozen_string_literal: true
class
VariableEntity
<
Grape
::
Entity
expose
:id
expose
:key
...
...
app/serializers/variable_serializer.rb
View file @
dce26700
# frozen_string_literal: true
class
VariableSerializer
<
BaseSerializer
entity
VariableEntity
end
changelogs/unreleased/frozen-string-enable-app-serializers.yml
0 → 100644
View file @
dce26700
---
title
:
Enable frozen string in app/serializers/**/*.rb
merge_request
:
20726
author
:
gfyoung
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