From 8c454b362425228ab14bb4ed5320f6ba2f505679 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 18 Feb 2016 18:19:43 -0500 Subject: Add a `Blob` model that wraps `Gitlab::Git::Blob` This allows us to take advantage of Rails' `to_partial_path` to render the correct partial based on the Blob type, rather than cluttering the view with conditionals. It also allows (and will allow in the future) better encapsulation for Blob-related logic which makes sense for our Rails app but might not make as much sense for the core `gitlab_git` library, such as detecting if the blob is an SVG. --- app/helpers/blob_helper.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'app/helpers/blob_helper.rb') diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 16967927922..7143a744869 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -127,10 +127,6 @@ module BlobHelper end end - def blob_svg?(blob) - blob.language && blob.language.name == 'SVG' - end - # SVGs can contain malicious JavaScript; only include whitelisted # elements and attributes. Note that this whitelist is by no means complete # and may omit some elements. -- cgit v1.2.1