Rails4: replace deprecated Relation#count with finder options at UsersHelper#users_status_options_for_select
git-svn-id: http://svn.redmine.org/redmine/trunk@12612 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9420d7e345
commit
fa544d9934
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
module UsersHelper
|
module UsersHelper
|
||||||
def users_status_options_for_select(selected)
|
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), ''],
|
options_for_select([[l(:label_all), ''],
|
||||||
["#{l(:status_active)} (#{user_count_by_status[1].to_i})", '1'],
|
["#{l(:status_active)} (#{user_count_by_status[1].to_i})", '1'],
|
||||||
["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", '2'],
|
["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", '2'],
|
||||||
|
|
Loading…
Reference in New Issue