srushti / goldberg

Goldberg is a lightweight CI server written in Ruby which worries about Bundler & RVM so that you don't have to.
Other
243 stars 29 forks source link

culprits code can cause home page not to render #123

Closed professor closed 11 years ago

professor commented 12 years ago

Error....

Rendered home/_projects.html.haml (264.0ms) Rendered home/_group_projects.html.haml (265.4ms) Completed 500 Internal Server Error in 397ms

ActionView::Template::Error (undefined method revision' for nil:NilClass): 16: %span.github-url 17: = link_to "on Github", project.github_url 18: - if !project.culprits_for_failure.empty? 19: %span.culprit 20: = "(Possible culprit(s): #{project.culprits_for_failure})" app/models/project.rb:103:incollect' app/models/project.rb:103:in culprits_for_failure' app/views/home/_projects.html.haml:19:inblock in _app_views_homeprojects_html_haml___4386309075124752201_7022616948964099748641549855113' app/views/home/_projects.html.haml:1:in each' app/views/home/_projects.html.haml:1:in_app_views_homeprojects_html_haml___4386309075124752201_7022616948964099748641549855113' app/views/home/_group_projects.html.haml:7:in block in _app_views_home__group_projects_html_haml___3791502564093199432_70226169760640__4108929104030263289' app/views/home/_group_projects.html.haml:5:ineach' app/views/home/_group_projects.html.haml:5:in _app_views_home__group_projects_html_haml___3791502564093199432_70226169760640__4108929104030263289' app/controllers/home_controller.rb:10:inprojects_partial'

A quick fix is to comment out the culprit code in the view/home/_project.html.haml -# if !project.culprits_for_failure.empty? %span.culprit = "(Possible culprit(s): #{project.culprits_for_failure})"

srushti commented 12 years ago

Yeah. I saw this happening when you add a new project and there are no builds on it. I thought I'd fixed it already a couple of months back. Clearly, I haven't.

I'll take a look at it.

srushti commented 11 years ago

I took a look at it later, but forgot to update it. This doesn't seem to be happening any more. Please let me know if this is still occurring for you. It's not for me.