]> source.dussan.org Git - redmine.git/commitdiff
Rails4: replace deprecated Relation#count with finder options at UsersHelper#users_st...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jan 2014 12:48:48 +0000 (12:48 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jan 2014 12:48:48 +0000 (12:48 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12612 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/users_helper.rb

index cfec1092fbc144d586c38130202af43bf5c49f06..6ef6a11c7a3666e827917839bce6c5f6a92fb6b9 100644 (file)
@@ -19,7 +19,7 @@
 
 module UsersHelper
   def users_status_options_for_select(selected)
-    user_count_by_status = User.count(:group => 'status').to_hash
+    user_count_by_status = User.group('status').count.to_hash
     options_for_select([[l(:label_all), ''],
                         ["#{l(:status_active)} (#{user_count_by_status[1].to_i})", '1'],
                         ["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", '2'],