From 0fad997a9397643144051ee54a08ff59659db105 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 14 Apr 2016 12:44:35 +0200 Subject: Properly handle bigger files --- app/models/blob.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/models/blob.rb') diff --git a/app/models/blob.rb b/app/models/blob.rb index 72e6c5fa3fd..0fea6b7f576 100644 --- a/app/models/blob.rb +++ b/app/models/blob.rb @@ -19,6 +19,14 @@ class Blob < SimpleDelegator new(blob) end + def no_highlighting? + size && size > 1.megabyte + end + + def only_display_raw? + size && size > 5.megabytes + end + def svg? text? && language && language.name == 'SVG' end -- cgit v1.2.1