Module: ProjectHelper
- Defined in:
- app/helpers/project_helper.rb
Instance Method Summary collapse
- #project_label(project) ⇒ Object
- #with_most_recent_commit(project) ⇒ Object
- #with_most_recent_release(project) ⇒ Object
- #with_most_recent_test_run(project) ⇒ Object
Instance Method Details
#project_label(project) ⇒ Object
27 28 29 30 |
# File 'app/helpers/project_helper.rb', line 27 def project_label(project) return '<b class="label unknown"> </b>'.html_safe unless project "<b class=\"label #{project.color}\">#{h project.slug.gsub("_", " ")}</b>".html_safe end |
#with_most_recent_commit(project) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/helpers/project_helper.rb', line 3 def with_most_recent_commit(project) commit = project.head if commit commit.project = project # so that _Commit_ doesn't load project again yield commit end end |
#with_most_recent_release(project) ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/helpers/project_helper.rb', line 11 def with_most_recent_release(project) release = @releases[project.id] if release release.project = project # so that _Release_ doesn't load project again yield release end end |
#with_most_recent_test_run(project) ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/helpers/project_helper.rb', line 19 def with_most_recent_test_run(project) test_run = @test_runs[project.id] if test_run test_run.project = project # so that _TestRun_ doesn't load project again yield test_run end end |