comparison app/helpers/users_helper.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children
comparison
equal deleted inserted replaced
1516:b450a9d58aed 1517:dffacf8a6908
17 # along with this program; if not, write to the Free Software 17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 19
20 module UsersHelper 20 module UsersHelper
21 def users_status_options_for_select(selected) 21 def users_status_options_for_select(selected)
22 user_count_by_status = User.count(:group => 'status').to_hash 22 user_count_by_status = User.group('status').count.to_hash
23 options_for_select([[l(:label_all), ''], 23 options_for_select([[l(:label_all), ''],
24 ["#{l(:status_active)} (#{user_count_by_status[1].to_i})", '1'], 24 ["#{l(:status_active)} (#{user_count_by_status[1].to_i})", '1'],
25 ["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", '2'], 25 ["#{l(:status_registered)} (#{user_count_by_status[2].to_i})", '2'],
26 ["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", '3']], selected.to_s) 26 ["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", '3']], selected.to_s)
27 end 27 end