Skip to content
Snippets Groups Projects
Commit f20a40f4 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'frozen-string-enable-app-models' into 'master'

Enable frozen string in app/models/*.rb

See merge request gitlab-org/gitlab-ce!20851
parents 2deb97ad 50abbd3e
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Showing
with 45 additions and 5 deletions
# frozen_string_literal: true
class Admin::ServicesController < Admin::ApplicationController
include ServiceParams
 
Loading
Loading
@@ -30,7 +32,7 @@ class Admin::ServicesController < Admin::ApplicationController
 
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
Loading
Loading
# frozen_string_literal: true
require_dependency 'declarative_policy'
 
class Ability
Loading
Loading
# frozen_string_literal: true
class AbuseReport < ActiveRecord::Base
include CacheMarkdownField
 
Loading
Loading
# frozen_string_literal: true
class ActiveSession
include ActiveModel::Model
 
Loading
Loading
# frozen_string_literal: true
class Appearance < ActiveRecord::Base
include CacheableAttributes
include CacheMarkdownField
Loading
Loading
# frozen_string_literal: true
class ApplicationSetting < ActiveRecord::Base
include CacheableAttributes
include CacheMarkdownField
Loading
Loading
# frozen_string_literal: true
class AuditEvent < ActiveRecord::Base
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
 
Loading
Loading
# frozen_string_literal: true
class AwardEmoji < ActiveRecord::Base
DOWNVOTE_NAME = "thumbsdown".freeze
UPVOTE_NAME = "thumbsup".freeze
Loading
Loading
# 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
Loading
Loading
# 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
Loading
Loading
# frozen_string_literal: true
class Board < ActiveRecord::Base
belongs_to :group
belongs_to :project
Loading
Loading
# frozen_string_literal: true
class BroadcastMessage < ActiveRecord::Base
include CacheMarkdownField
include Sortable
Loading
Loading
# frozen_string_literal: true
class ChatName < ActiveRecord::Base
LAST_USED_AT_INTERVAL = 1.hour
 
Loading
Loading
# frozen_string_literal: true
class ChatTeam < ActiveRecord::Base
validates :team_id, presence: true
validates :namespace, uniqueness: true
Loading
Loading
# coding: utf-8
# frozen_string_literal: true
class Commit
extend ActiveModel::Naming
extend Gitlab::Cache::RequestCache
Loading
Loading
@@ -339,21 +341,21 @@ class Commit
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)
Loading
Loading
# frozen_string_literal: true
# CommitRange makes it easier to work with commit ranges
#
# Examples:
Loading
Loading
# frozen_string_literal: true
class CommitStatus < ActiveRecord::Base
include HasStatus
include Importable
Loading
Loading
# frozen_string_literal: true
class Compare
include Gitlab::Utils::StrongMemoize
 
Loading
Loading
# frozen_string_literal: true
class ContainerRepository < ActiveRecord::Base
belongs_to :project
 
Loading
Loading
# frozen_string_literal: true
class CycleAnalytics
STAGES = %i[issue plan code test review staging production].freeze
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment