]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2327 Fix problem with Derby for SQL request
authorFabrice Bellingard <bellingard@gmail.com>
Mon, 2 May 2011 12:19:24 +0000 (14:19 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Mon, 2 May 2011 12:19:24 +0000 (14:19 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/review.rb

index 8d0f03590494c9ca2c4f73c68292a1797a6ab2ce..3a45ff5b0edfe8f5afd3d96b44dca5fde3910f33 100644 (file)
@@ -109,18 +109,20 @@ class Review < ActiveRecord::Base
     if authors && authors.size>0 && !authors[0].blank?
       conditions << 'user_id in (:authors)'
       unless Api::Utils.is_number?(authors[0])
-        authors=User.logins_to_ids(authors)
+        values[:authors]=User.logins_to_ids(authors)
+      else
+        values[:authors]=authors.map{|user_id| user_id.to_i}
       end
-      values[:authors]=authors
     end
 
     assignees=options['assignees'].split(',') if options['assignees']
     if assignees && assignees.size>0 && !assignees[0].blank?
       conditions << 'assignee_id in (:assignees)'
       unless Api::Utils.is_number?(assignees[0])
-        assignees=User.logins_to_ids(assignees)
+        values[:assignees]=User.logins_to_ids(assignees)
+      else
+        values[:assignees]=assignees.map{|user_id| user_id.to_i}
       end
-      values[:assignees]=assignees
     end
 
     Review.find(:all, :include => [ 'review_comments' ], :order => 'created_at DESC', :conditions => [conditions.join(' AND '), values], :limit => 200)