summaryrefslogtreecommitdiff
path: root/app/models/tree.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-31 23:48:12 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-31 23:48:12 +0300
commitbbfbff3add4c78ce1256ac3bbe787cc6eb9fe1b9 (patch)
tree52fca95c2741559ab0961962a863c7ccb1a7e42b /app/models/tree.rb
parentb53557aca64fbf55f9bbd59849d83daa10b7361f (diff)
downloadgitlab-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.rb8
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