From 313b9dcc5c88afa6e04d23d6c0f120eb3ba3a70f Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Tue, 15 May 2012 11:13:25 +0200 Subject: [PATCH] SONAR-2706 Fix issue detected by ITs --- sonar-server/src/main/webapp/WEB-INF/app/models/review.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb index 3ff214a893e..38dda8eccdd 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb @@ -80,13 +80,14 @@ class Review < ActiveRecord::Base if review_command_id review_context = Api::ReviewContext.new(:review => self, :user => User.new(:login => comment_values[:user].login), :params => {"comment.text" => comment_values[:text]}) Java::OrgSonarServerUi::JRubyFacade.getInstance().executeCommandActions(review_command_id, review_context.to_string_map) + # need to reload the comments as the executed action will have created a new one + comments.reload + comment = comments.last else # simple comment comment = comments.create!(comment_values) end touch - comments.reload - comment = comments.last notification_manager.notifyChanged(id.to_i, comment.user.login.to_java, to_java_map, to_java_map("comment" => comment.text)) end -- 2.39.5