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

Get rid of more requires, which causes warnings when code is reloaded


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 1fbea7ce
Branches
Tags
2 merge requests!4779Test/#123 Master,!3810Define constants only if not defined yet and freeze them
Pipeline #
Loading
Loading
@@ -12,11 +12,11 @@ class Commit
 
attr_accessor :project
 
DIFF_SAFE_LINES ||= Gitlab::Git::DiffCollection::DEFAULT_LIMITS[:max_lines]
DIFF_SAFE_LINES = Gitlab::Git::DiffCollection::DEFAULT_LIMITS[:max_lines]
 
# Commits above this size will not be rendered in HTML
DIFF_HARD_LIMIT_FILES ||= 1000
DIFF_HARD_LIMIT_LINES ||= 50000
DIFF_HARD_LIMIT_FILES = 1000
DIFF_HARD_LIMIT_LINES = 50000
 
class << self
def decorate(commits, project)
Loading
Loading
Loading
Loading
@@ -27,9 +27,6 @@
# merge_commit_sha :string
#
 
require Rails.root.join("app/models/commit")
require Rails.root.join("lib/static_model")
class MergeRequest < ActiveRecord::Base
include InternalId
include Issuable
Loading
Loading
Loading
Loading
@@ -11,8 +11,6 @@
# updated_at :datetime
#
 
require Rails.root.join("app/models/commit")
class MergeRequestDiff < ActiveRecord::Base
include Sortable
 
Loading
Loading
class FileSizeValidator < ActiveModel::EachValidator
MESSAGES ||= { is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze
CHECKS ||= { is: :==, minimum: :>=, maximum: :<= }.freeze
MESSAGES = { is: :wrong_size, minimum: :size_too_small, maximum: :size_too_big }.freeze
CHECKS = { is: :==, minimum: :>=, maximum: :<= }.freeze
 
DEFAULT_TOKENIZER ||= -> (value) { value.split(//) }.freeze
RESERVED_OPTIONS ||= [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long].freeze
DEFAULT_TOKENIZER = -> (value) { value.split(//) }.freeze
RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long].freeze
 
def initialize(options)
if range = (options.delete(:in) || options.delete(:within))
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment