diff options
author | Rémy Coutable <remy@rymai.me> | 2016-04-19 10:37:50 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-04-19 10:37:50 +0200 |
commit | 2e9f03e5141368af6075723969fb031d5315e9c0 (patch) | |
tree | e8a299f16fa633c123680dfd409128b9775b32f4 /app/models/commit.rb | |
parent | 53a1d705fe536ad373faa77ba1ef5196ff49a98b (diff) | |
download | gitlab-ce-2e9f03e5141368af6075723969fb031d5315e9c0.tar.gz |
Define constants only if not defined yet and freeze them
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index d1f07ccd55c..f5d1e242e75 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -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 unless defined?(DIFF_HARD_LIMIT_FILES) - DIFF_HARD_LIMIT_LINES = 50000 unless defined?(DIFF_HARD_LIMIT_LINES) + DIFF_HARD_LIMIT_FILES ||= 1000 + DIFF_HARD_LIMIT_LINES ||= 50000 class << self def decorate(commits, project) |