From 3d5f71dac7f30719c1cfdee6979b8c3597e080a1 Mon Sep 17 00:00:00 2001 From: Sam Saffron <sam.saffron@gmail.com> Date: Wed, 9 Oct 2019 13:06:18 +1100 Subject: [PATCH] DEV: stop mixing in application helper where not needed We were mixing in 20 or so methods into a controller just to use a single one. The helper itself is not the actual implementation anyway... MobileDetection is responsible here. --- app/controllers/groups_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 461a98074b8..f0ed98e57d6 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true class GroupsController < ApplicationController - include ApplicationHelper - requires_login only: [ :set_notifications, :mentionable, @@ -46,7 +44,7 @@ class GroupsController < ApplicationController raise Discourse::InvalidAccess.new(:enable_group_directory) end - page_size = mobile_device? ? 15 : 36 + page_size = MobileDetection.mobile_device?(request.user_agent) ? 15 : 36 page = params[:page]&.to_i || 0 order = %w{name user_count}.delete(params[:order]) dir = params[:asc] ? 'ASC' : 'DESC'