From c88d7eedf818609adf829cb89d06869b7939573b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 1 Oct 2013 20:31:03 +0200 Subject: [PATCH] Moved to user assets. --- app/controllers/sessions_controller.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 977c73fb3..6879a1bdc 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -163,22 +163,18 @@ class SessionsController < ApplicationController def list return if deny_if_not_role('Admin') sessions = ActiveRecord::SessionStore::Session.order('updated_at DESC').limit(10000) - users = {} + assets = {} sessions_clean = [] sessions.each {|session| next if !session.data['user_id'] sessions_clean.push session if session.data['user_id'] - if !users[ session.data['user_id'] ] - users[ session.data['user_id'] ] = User.user_data_full( session.data['user_id'] ) - end + assets = user.assets( assets ) end } render :json => { :sessions => sessions_clean, - :assets => { - User.to_app_model => users, - }, + :assets => assets, } end