make 🤖 rubocop happy
This commit is contained in:
parent
3cd4c82c49
commit
131b7f5da5
|
@ -11,11 +11,11 @@ class DirectoryItemsController < ApplicationController
|
|||
result = DirectoryItem.where(period_type: period_type).includes(:user)
|
||||
|
||||
if params[:group]
|
||||
result = result.includes(user: :groups).where(users: {groups: {name: params[:group]}})
|
||||
result = result.includes(user: :groups).where(users: { groups: { name: params[:group] } })
|
||||
end
|
||||
|
||||
if params[:exclude_usernames]
|
||||
result = result.references(:user).where.not(users: {username: params[:exclude_usernames].split(",")})
|
||||
result = result.references(:user).where.not(users: { username: params[:exclude_usernames].split(",") })
|
||||
end
|
||||
|
||||
order = params[:order] || DirectoryItem.headings.first
|
||||
|
|
|
@ -5,7 +5,7 @@ describe DirectoryItemsController do
|
|||
let!(:evil_trout) { Fabricate(:evil_trout) }
|
||||
let!(:walter_white) { Fabricate(:walter_white) }
|
||||
let!(:stage_user) { Fabricate(:staged, username: 'stage_user') }
|
||||
let!(:group) { Fabricate(:group, users: [evil_trout,stage_user]) }
|
||||
let!(:group) { Fabricate(:group, users: [evil_trout, stage_user]) }
|
||||
|
||||
it "requires a `period` param" do
|
||||
get '/directory_items.json'
|
||||
|
|
Loading…
Reference in New Issue