]> source.dussan.org Git - redmine.git/commitdiff
Code cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 22 Nov 2014 09:42:09 +0000 (09:42 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 22 Nov 2014 09:42:09 +0000 (09:42 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13626 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb

index 4d81c47abc622005e2a8e7e16b872899d496a22b..f1ff1a6beb5278e44f44f48009b8ec092e614551 100644 (file)
@@ -283,8 +283,7 @@ class Repository < ActiveRecord::Base
 
   # Returns an array of committers usernames and associated user_id
   def committers
-    @committers ||= Changeset.connection.select_rows(
-         "SELECT DISTINCT committer, user_id FROM #{Changeset.table_name} WHERE repository_id = #{id}")
+    @committers ||= Changeset.where(:repository_id => id).uniq.pluck(:committer, :user_id)
   end
 
   # Maps committers username to a user ids