Enable frozen string in app/serializers/**/*.rb
Partially addresses #47424.
This commit is contained in:
parent
e23b966d8d
commit
dce26700b2
100 changed files with 216 additions and 8 deletions
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsBuildEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
include EntityDateHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsBuildSerializer < BaseSerializer
|
||||
entity AnalyticsBuildEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsCommitEntity < CommitEntity
|
||||
include EntityDateHelper
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsCommitSerializer < BaseSerializer
|
||||
entity AnalyticsCommitEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsGenericSerializer < BaseSerializer
|
||||
def represent(resource, opts = {})
|
||||
resource.symbolize_keys!
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsIssueEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
include EntityDateHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsIssueSerializer < AnalyticsGenericSerializer
|
||||
entity AnalyticsIssueEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsMergeRequestEntity < AnalyticsIssueEntity
|
||||
expose :state
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsMergeRequestSerializer < AnalyticsGenericSerializer
|
||||
entity AnalyticsMergeRequestEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsStageEntity < Grape::Entity
|
||||
include EntityDateHelper
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsStageSerializer < BaseSerializer
|
||||
entity AnalyticsStageEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsSummaryEntity < Grape::Entity
|
||||
expose :value, safe: true
|
||||
expose :title
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AnalyticsSummarySerializer < BaseSerializer
|
||||
entity AnalyticsSummaryEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AwardEmojiEntity < Grape::Entity
|
||||
expose :name
|
||||
expose :user, using: API::Entities::UserSafe
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BaseSerializer
|
||||
attr_reader :params
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BlobEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BuildActionEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BuildArtifactEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BuildDetailsEntity < JobEntity
|
||||
expose :coverage, :erased_at, :duration
|
||||
expose :tag_list, as: :tags
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BuildMetadataEntity < Grape::Entity
|
||||
expose :timeout_human_readable
|
||||
expose :timeout_source do |metadata|
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class BuildSerializer < BaseSerializer
|
||||
entity JobEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ClusterApplicationEntity < Grape::Entity
|
||||
expose :name
|
||||
expose :status_name, as: :status
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ClusterEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ClusterSerializer < BaseSerializer
|
||||
entity ClusterEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CohortActivityMonthEntity < Grape::Entity
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CohortEntity < Grape::Entity
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CohortsEntity < Grape::Entity
|
||||
expose :months_included
|
||||
expose :cohorts, using: CohortEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CohortsSerializer < AnalyticsGenericSerializer
|
||||
entity CohortsEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CommitEntity < API::Entities::Commit
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module WithPagination
|
||||
attr_accessor :paginator
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ContainerRepositoriesSerializer < BaseSerializer
|
||||
entity ContainerRepositoryEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ContainerRepositoryEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ContainerTagEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ContainerTagsSerializer < BaseSerializer
|
||||
entity ContainerTagEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DeployKeyEntity < Grape::Entity
|
||||
expose :id
|
||||
expose :user_id
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DeployKeySerializer < BaseSerializer
|
||||
entity DeployKeyEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DeployKeysProjectEntity < Grape::Entity
|
||||
expose :can_push
|
||||
expose :project, using: ProjectEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DeploymentEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DeploymentSerializer < BaseSerializer
|
||||
entity DeploymentEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DiffFileEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
include BlobHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DiffsEntity < Grape::Entity
|
||||
include DiffHelper
|
||||
include RequestAwareEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DiffsSerializer < BaseSerializer
|
||||
entity DiffsEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DiscussionEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
include NotesHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DiscussionSerializer < BaseSerializer
|
||||
entity DiscussionEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class EnvironmentEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class EnvironmentSerializer < BaseSerializer
|
||||
include WithPagination
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupChildEntity < Grape::Entity
|
||||
include ActionView::Helpers::NumberHelper
|
||||
include RequestAwareEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupChildSerializer < BaseSerializer
|
||||
include WithPagination
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupEntity < Grape::Entity
|
||||
include ActionView::Helpers::NumberHelper
|
||||
include RequestAwareEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupSerializer < BaseSerializer
|
||||
include WithPagination
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupVariableEntity < Grape::Entity
|
||||
expose :id
|
||||
expose :key
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupVariableSerializer < BaseSerializer
|
||||
entity GroupVariableEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IssuableEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IssuableSidebarEntity < Grape::Entity
|
||||
include TimeTrackableEntity
|
||||
include RequestAwareEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IssueEntity < IssuableEntity
|
||||
include TimeTrackableEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IssueSidebarEntity < IssuableSidebarEntity
|
||||
expose :assignees, using: API::Entities::UserBasic
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class JobEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class JobGroupEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class LabelEntity < Grape::Entity
|
||||
expose :id, if: ->(label, _) { !label.is_a?(GlobalLabel) }
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class LabelSerializer < BaseSerializer
|
||||
entity LabelEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class LfsFileLockEntity < Grape::Entity
|
||||
root 'locks', 'lock'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class LfsFileLockSerializer < BaseSerializer
|
||||
entity LfsFileLockEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeRequestBasicEntity < IssuableSidebarEntity
|
||||
expose :assignee_id
|
||||
expose :merge_status
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeRequestBasicSerializer < BaseSerializer
|
||||
entity MergeRequestBasicEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeRequestCreateEntity < Grape::Entity
|
||||
expose :iid
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeRequestCreateSerializer < BaseSerializer
|
||||
entity MergeRequestCreateEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeRequestDiffEntity < Grape::Entity
|
||||
include Gitlab::Routing
|
||||
include GitHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeRequestMetricsEntity < Grape::Entity
|
||||
expose :latest_closed_at, as: :closed_at
|
||||
expose :merged_at
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# 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.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeRequestUserEntity < UserEntity
|
||||
include RequestAwareEntity
|
||||
include BlobHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MergeRequestWidgetEntity < IssuableEntity
|
||||
expose :state
|
||||
expose :in_progress_merge_commit_sha
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class NoteAttachmentEntity < Grape::Entity
|
||||
expose :url
|
||||
expose :filename
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class NoteEntity < API::Entities::Note
|
||||
include RequestAwareEntity
|
||||
include NotesHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class NoteUserEntity < UserEntity
|
||||
unexpose :web_url
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PipelineDetailsEntity < PipelineEntity
|
||||
expose :details do
|
||||
expose :ordered_stages, as: :stages, using: StageEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PipelineEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PipelineSerializer < BaseSerializer
|
||||
include WithPagination
|
||||
entity PipelineDetailsEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ProjectEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ProjectMirrorEntity < Grape::Entity
|
||||
expose :id
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ProjectNoteEntity < NoteEntity
|
||||
expose :human_access do |note|
|
||||
note.project.team.human_max_access(note.author_id)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ProjectNoteSerializer < BaseSerializer
|
||||
entity ProjectNoteEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class ProjectSerializer < BaseSerializer
|
||||
entity ProjectEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module RequestAwareEntity
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RunnerEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class StageEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class StageSerializer < BaseSerializer
|
||||
include WithPagination
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class StatusEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class SubmoduleEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module TimeTrackableEntity
|
||||
extend ActiveSupport::Concern
|
||||
extend Grape
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TreeEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# TODO: Inherit from TreeEntity, when `Tree` implements `id` and `name` like `Gitlab::Git::Tree`.
|
||||
class TreeRootEntity < Grape::Entity
|
||||
include RequestAwareEntity
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TreeSerializer < BaseSerializer
|
||||
entity TreeRootEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UserEntity < API::Entities::UserBasic
|
||||
include RequestAwareEntity
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class UserSerializer < BaseSerializer
|
||||
entity UserEntity
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class VariableEntity < Grape::Entity
|
||||
expose :id
|
||||
expose :key
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class VariableSerializer < BaseSerializer
|
||||
entity VariableEntity
|
||||
end
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Enable frozen string in app/serializers/**/*.rb
|
||||
merge_request: 20726
|
||||
author: gfyoung
|
||||
type: performance
|
Loading…
Reference in a new issue