diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-31 23:48:12 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-31 23:48:12 +0300 |
commit | bbfbff3add4c78ce1256ac3bbe787cc6eb9fe1b9 (patch) | |
tree | 52fca95c2741559ab0961962a863c7ccb1a7e42b /app/models/tree.rb | |
parent | b53557aca64fbf55f9bbd59849d83daa10b7361f (diff) | |
download | gitlab-ce-bbfbff3add4c78ce1256ac3bbe787cc6eb9fe1b9.tar.gz |
Extend models functionality with old decorator methods. Use Repository model
Diffstat (limited to 'app/models/tree.rb')
-rw-r--r-- | app/models/tree.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/tree.rb b/app/models/tree.rb index 96395a42394..4b6c5b133e9 100644 --- a/app/models/tree.rb +++ b/app/models/tree.rb @@ -26,4 +26,12 @@ class Tree def empty? data.blank? end + + def up_dir? + path.present? + end + + def readme + @readme ||= contents.find { |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i } + end end |