diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-12-15 10:42:24 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-12-15 10:42:24 +0400 |
commit | ed3f3a0d4ded937b8c9864b006c15ce8148f35c1 (patch) | |
tree | 281900d16f779ab146ff6a3d231f78426efdea56 /app/decorators | |
parent | 0712e78597e5954ea61def4c0a6836a3d5b5d275 (diff) |
Download link for binary
Diffstat (limited to 'app/decorators')
-rw-r--r-- | app/decorators/tree_decorator.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/decorators/tree_decorator.rb b/app/decorators/tree_decorator.rb index 11af9724c0f..c2a640f6202 100644 --- a/app/decorators/tree_decorator.rb +++ b/app/decorators/tree_decorator.rb @@ -32,4 +32,13 @@ class TreeDecorator < ApplicationDecorator def history_path h.project_commits_path(project, :path => path, :ref => ref) end + + def mb_size + size = (tree.size / 1024) + if size < 1024 + "#{size} KB" + else + "#{size/1024} MB" + end + end end |