Permalink
Browse files

simplify admin users handling

  • Loading branch information...
1 parent 9fb8522 commit cc53cc4f9f685cac866845b4fff92cddce74b789 @lukebaker lukebaker committed Jul 24, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/controllers/abingo_dashboard_controller.rb
@@ -21,8 +21,8 @@ def show_set
ids = @grouped_experiments[params[:id]]
@experiments = Abingo::Experiment.find(ids, :include => :alternatives)
- admin_users = User.find(:all, :conditions => {:admin => true})
- admin_user_list = admin_users.inject([]){|list, u| list << u.id}
+ admin_users = User.find(:all, :select => 'id', :conditions => {:admin => true})
+ admin_user_list = admin_users.map{|u| u.id}
session_list = get_session_list(@experiments, admin_user_list)
session_ids = session_list.map{|s| s['session_id'] }
@@ -48,8 +48,8 @@ def show_set
def show
@experiment = Abingo::Experiment.find(params[:id], :include => :alternatives)
- admin_users = User.find(:all, :conditions => {:admin => true})
- admin_user_list = admin_users.inject([]){|list, u| list << u.id}
+ admin_users = User.find(:all, :select => 'id', :conditions => {:admin => true})
+ admin_user_list = admin_users.map{|u| u.id}
session_list = get_session_list(@experiment, admin_user_list)
session_ids = session_list.map{|s| s['session_id'] }

0 comments on commit cc53cc4

Please sign in to comment.