Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify admin users handling

  • Loading branch information...
commit cc53cc4f9f685cac866845b4fff92cddce74b789 1 parent 9fb8522
@lukebaker lukebaker authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/controllers/abingo_dashboard_controller.rb
View
8 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'] }
Please sign in to comment.
Something went wrong with that request. Please try again.