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.
This commit is contained in:
Sam Saffron 2019-10-09 13:06:18 +11:00
parent 602215a273
commit 3d5f71dac7
1 changed files with 1 additions and 3 deletions

View File

@ -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'