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 21:28:39 +0200
commitad99404d2588e182a115d89b0b457d957e8ca7b6 (patch)
tree527619b709363e1515c41c0d8f861995389a58d4 /app/models/snippet.rb
parent3fd0f5374447f0763c60d5b10b35d4a6f6981497 (diff)
downloadgitlab-ce-ad99404d2588e182a115d89b0b457d957e8ca7b6.tar.gz
Properly handle bigger files
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.
#