Permalink
Browse files

try fixing the result image responder

  • Loading branch information...
1 parent 880e5d2 commit 59d839edddf76a79256e9e4105771c87874fad9e @svenfuchs svenfuchs committed Dec 11, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/responders/result_image.rb
@@ -1,6 +1,6 @@
module Responders
module ResultImage
- STATUS_NAMES = { nil => 'unknown', 0 => 'passing', 1 => 'failing' }
+ STATUS_NAMES = { default: 'unknown', passed: 'passing', failed: 'failing' }
delegate :params, :headers, :send_file, :to => :controller
@@ -28,7 +28,8 @@ def path
end
def result
- STATUS_NAMES[resource.try(:last_build_result_on, controller.params)]
+ result = resource ? resource.builds.last_state_on(controller.params) : nil
+ STATUS_NAMES[result] || STATUS_NAMES[:default]
end
end
end

0 comments on commit 59d839e

Please sign in to comment.