summaryrefslogtreecommitdiff
path: root/app/models/snippet.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-14 12:44:35 +0200
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-28 20:59:13 +0200
commit0fad997a9397643144051ee54a08ff59659db105 (patch)
tree9823ba9c040d0c0d0e2e0d51f27c15c2e7ae3bd9 /app/models/snippet.rb
parenta792427eed95570da22844a06a09227730443189 (diff)
downloadgitlab-ce-zj-large-files-no-highlight.tar.gz
Properly handle bigger fileszj-large-files-no-highlight
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index b96e3937281..0fd08061925 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -112,6 +112,10 @@ class Snippet < ActiveRecord::Base
visibility_level
end
+ def no_highlighting?
+ content.lines.count > 1000
+ end
+
class << self
# Searches for snippets with a matching title or file name.
#