Skip to content
Snippets Groups Projects
Commit 76e1ca64 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

tree.readme method added

parent 453b2ae6
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -28,4 +28,8 @@ class TreeDecorator < ApplicationDecorator
file = File.join(path, "..")
h.project_tree_path(project, h.tree_join(ref, file))
end
def readme
@readme ||= contents.find { |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }
end
end
Loading
Loading
@@ -32,8 +32,8 @@
 
= render_tree(tree.contents)
 
- if readme = tree.contents.find { |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }
= render "tree/readme", readme: readme
- if tree.readme
= render "tree/readme", readme: tree.readme
 
- unless tree.is_blob?
:javascript
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment