make 🤖 rubocop happy

This commit is contained in:
Régis Hanol 2018-05-16 16:35:04 +02:00
parent 3cd4c82c49
commit 131b7f5da5
2 changed files with 3 additions and 3 deletions

View File

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

View File

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