Commit 7494e171 authored by gfyoung's avatar gfyoung
Browse files

Enable frozen string in app/models/*.rb

Partially addresses #47424.
parent afa505583336
# frozen_string_literal: true
class Admin::ServicesController < Admin::ApplicationController
include ServiceParams
......@@ -30,7 +32,7 @@ def update
def services_templates
Service.available_services_names.map do |service_name|
service_template = service_name.concat("_service").camelize.constantize
service_template = "#{service_name}_service".camelize.constantize
service_template.where(template: true).first_or_create
end
end
......
# frozen_string_literal: true
require_dependency 'declarative_policy'
class Ability
......
# frozen_string_literal: true
class AbuseReport < ActiveRecord::Base
include CacheMarkdownField
......
# frozen_string_literal: true
class ActiveSession
include ActiveModel::Model
......
# frozen_string_literal: true
class Appearance < ActiveRecord::Base
include CacheableAttributes
include CacheMarkdownField
......
# frozen_string_literal: true
class ApplicationSetting < ActiveRecord::Base
include CacheableAttributes
include CacheMarkdownField
......
# frozen_string_literal: true
class AuditEvent < ActiveRecord::Base
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
......
# frozen_string_literal: true
class AwardEmoji < ActiveRecord::Base
DOWNVOTE_NAME = "thumbsdown".freeze
UPVOTE_NAME = "thumbsup".freeze
......
# frozen_string_literal: true
class Badge < ActiveRecord::Base
# This structure sets the placeholders that the urls
# can have. This hash also sets which action to ask when
......
# frozen_string_literal: true
# Blob is a Rails-specific wrapper around Gitlab::Git::Blob objects
class Blob < SimpleDelegator
CACHE_TIME = 60 # Cache raw blobs referred to by a (mutable) ref for 1 minute
......
# frozen_string_literal: true
class Board < ActiveRecord::Base
belongs_to :group
belongs_to :project
......
# frozen_string_literal: true
class BroadcastMessage < ActiveRecord::Base
include CacheMarkdownField
include Sortable
......
# frozen_string_literal: true
class ChatName < ActiveRecord::Base
LAST_USED_AT_INTERVAL = 1.hour
......
# frozen_string_literal: true
class ChatTeam < ActiveRecord::Base
validates :team_id, presence: true
validates :namespace, uniqueness: true
......
# coding: utf-8
# frozen_string_literal: true
class Commit
extend ActiveModel::Naming
extend Gitlab::Cache::RequestCache
......@@ -339,21 +341,21 @@ def cherry_pick_branch_name
end
def cherry_pick_description(user)
message_body = "(cherry picked from commit #{sha})"
message_body = ["(cherry picked from commit #{sha})"]
if merged_merge_request?(user)
commits_in_merge_request = merged_merge_request(user).commits
if commits_in_merge_request.present?
message_body << "\n"
message_body << ""
commits_in_merge_request.reverse.each do |commit_in_merge|
message_body << "\n#{commit_in_merge.short_id} #{commit_in_merge.title}"
message_body << "#{commit_in_merge.short_id} #{commit_in_merge.title}"
end
end
end
message_body
message_body.join("\n")
end
def cherry_pick_message(user)
......
# frozen_string_literal: true
# CommitRange makes it easier to work with commit ranges
#
# Examples:
......
# frozen_string_literal: true
class CommitStatus < ActiveRecord::Base
include HasStatus
include Importable
......
# frozen_string_literal: true
class Compare
include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
class ContainerRepository < ActiveRecord::Base
belongs_to :project
......
# frozen_string_literal: true
class CycleAnalytics
STAGES = %i[issue plan code test review staging production].freeze
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment