Skip to content

Commit

Permalink
[api] fix crash on factory reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Dec 17, 2012
1 parent 8867995 commit 2f8a5e3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/api/app/models/bs_request.rb
Expand Up @@ -607,9 +607,11 @@ def events
last_review_item = nil
self.reviews.each do |item|
if [:accepted, :declined].include?(item.state)
ct = events[item.created_at] || { who: item.creator, what: "added review", when: item.created_at }
ct[:comment] ||= item.reason
events[item.created_at] = ct
if item.creator # default reviews in a project are not "added"
ct = events[item.created_at] || { who: item.creator, what: "added review", when: item.created_at }
ct[:comment] ||= item.reason
events[item.created_at] = ct
end

events[item.updated_at] = {:who => item.reviewer, :what => "#{item.state} review", :when => item.updated_at, :comment => item.reason}
events[item.updated_at][:color] = "green" if item.state == :accepted
Expand Down

0 comments on commit 2f8a5e3

Please sign in to comment.