From ac0146a08eb2ec6c23b46ea014376b7a70a21415 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Thu, 6 Apr 2017 13:12:12 +0100 Subject: Use serializer for formatting cohorts data --- app/controllers/admin/cohorts_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/admin/cohorts_controller.rb b/app/controllers/admin/cohorts_controller.rb index 947afe3a028..9b77c554908 100644 --- a/app/controllers/admin/cohorts_controller.rb +++ b/app/controllers/admin/cohorts_controller.rb @@ -1,9 +1,11 @@ class Admin::CohortsController < Admin::ApplicationController def index - if ApplicationSetting.current.usage_ping_enabled - @cohorts = Rails.cache.fetch('cohorts', expires_in: 1.day) do + if current_application_settings.usage_ping_enabled + cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do CohortsService.new.execute end + + @cohorts = CohortsSerializer.new.represent(cohorts_results) end end end -- cgit v1.2.1