diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-02-18 18:19:43 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-18 22:45:30 -0500 |
commit | 8c454b362425228ab14bb4ed5320f6ba2f505679 (patch) | |
tree | 764f96718fd1efef5ccc3eba458db63b6f1aa8d7 /app/controllers | |
parent | ea4d2741a2b574407b0bd387ccd6a8202c014fc5 (diff) | |
download | gitlab-ce-8c454b362425228ab14bb4ed5320f6ba2f505679.tar.gz |
Add a `Blob` model that wraps `Gitlab::Git::Blob`rs-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.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 495a432347e..cd8b2911674 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -87,7 +87,7 @@ class Projects::BlobController < Projects::ApplicationController private def blob - @blob ||= @repository.blob_at(@commit.id, @path) + @blob ||= Blob.decorate(@repository.blob_at(@commit.id, @path)) if @blob @blob |