]> source.dussan.org Git - redmine.git/commitdiff
Fixed undefined method `compact!' error when additional_user_ids is empty (#19253).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Mar 2015 16:21:59 +0000 (16:21 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Mar 2015 16:21:59 +0000 (16:21 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@14053 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/repositories_controller.rb
test/functional/repositories_controller_test.rb

index 6e968f90912dd347ee734e1d603069799b026e26..364b834efa538e741848d913143faee4b033001f 100644 (file)
@@ -92,7 +92,7 @@ class RepositoriesController < ApplicationController
 
   def committers
     @committers = @repository.committers
-    @users = @project.users
+    @users = @project.users.to_a
     additional_user_ids = @committers.collect(&:last).collect(&:to_i) - @users.collect(&:id)
     @users += User.where(:id => additional_user_ids).to_a unless additional_user_ids.empty?
     @users.compact!
index 3e0fa596388d107c4ec1af01ae4aa0e129bb8920..056375ca8d43892f9a2bb4c4929dfb5b55c2cce5 100644 (file)
@@ -279,6 +279,15 @@ class RepositoriesControllerTest < ActionController::TestCase
     assert_select 'input[value=foo] + select option[selected=selected]', 0 # no option selected
   end
 
+  def test_get_committers_without_changesets
+    Changeset.delete_all
+    @request.session[:user_id] = 2
+
+    get :committers, :id => 10
+    assert_response :success
+    assert_template 'committers'
+  end
+
   def test_post_committers
     @request.session[:user_id] = 2
     # add a commit with an unknown user