Commit 55f044ae authored by Yorick Peterse's avatar Yorick Peterse

Fixed autocomplete related conflicts

parent 68c1a217
class AutocompleteController < ApplicationController class AutocompleteController < ApplicationController
<<<<<<< HEAD
prepend EE::AutocompleteController prepend EE::AutocompleteController
=======
>>>>>>> upstream/master
skip_before_action :authenticate_user!, only: [:users, :award_emojis] skip_before_action :authenticate_user!, only: [:users, :award_emojis]
def users def users
...@@ -14,7 +11,6 @@ class AutocompleteController < ApplicationController ...@@ -14,7 +11,6 @@ class AutocompleteController < ApplicationController
group = Autocomplete::GroupFinder group = Autocomplete::GroupFinder
.new(current_user, project, params) .new(current_user, project, params)
.execute .execute
<<<<<<< HEAD
users = Autocomplete::UsersFinder users = Autocomplete::UsersFinder
.new(params: params, current_user: current_user, project: project, group: group) .new(params: params, current_user: current_user, project: project, group: group)
...@@ -23,16 +19,6 @@ class AutocompleteController < ApplicationController ...@@ -23,16 +19,6 @@ class AutocompleteController < ApplicationController
render json: UserSerializer.new.represent(users) render json: UserSerializer.new.represent(users)
end end
=======
users = Autocomplete::UsersFinder
.new(params: params, current_user: current_user, project: project, group: group)
.execute
render json: UserSerializer.new.represent(users)
end
>>>>>>> upstream/master
def user def user
user = UserFinder.new(params).execute! user = UserFinder.new(params).execute!
......
...@@ -2,11 +2,8 @@ ...@@ -2,11 +2,8 @@
module Autocomplete module Autocomplete
class UsersFinder class UsersFinder
<<<<<<< HEAD
prepend EE::Autocomplete::UsersFinder prepend EE::Autocomplete::UsersFinder
=======
>>>>>>> upstream/master
# The number of users to display in the results is hardcoded to 20, and # The number of users to display in the results is hardcoded to 20, and
# pagination is not supported. This ensures that performance remains # pagination is not supported. This ensures that performance remains
# consistent and removes the need for implementing keyset pagination to # consistent and removes the need for implementing keyset pagination to
......
...@@ -20,11 +20,8 @@ class User < ActiveRecord::Base ...@@ -20,11 +20,8 @@ class User < ActiveRecord::Base
include BlocksJsonSerialization include BlocksJsonSerialization
include WithUploads include WithUploads
include OptionallySearch include OptionallySearch
<<<<<<< HEAD
prepend EE::User prepend EE::User
=======
>>>>>>> upstream/master
DEFAULT_NOTIFICATION_LEVEL = :participating DEFAULT_NOTIFICATION_LEVEL = :participating
...@@ -261,14 +258,11 @@ class User < ActiveRecord::Base ...@@ -261,14 +258,11 @@ class User < ActiveRecord::Base
scope :external, -> { where(external: true) } scope :external, -> { where(external: true) }
scope :active, -> { with_state(:active).non_internal } scope :active, -> { with_state(:active).non_internal }
scope :without_projects, -> { joins('LEFT JOIN project_authorizations ON users.id = project_authorizations.user_id').where(project_authorizations: { user_id: nil }) } scope :without_projects, -> { joins('LEFT JOIN project_authorizations ON users.id = project_authorizations.user_id').where(project_authorizations: { user_id: nil }) }
<<<<<<< HEAD
scope :subscribed_for_admin_email, -> { where(admin_email_unsubscribed_at: nil) } scope :subscribed_for_admin_email, -> { where(admin_email_unsubscribed_at: nil) }
scope :ldap, -> { joins(:identities).where('identities.provider LIKE ?', 'ldap%') } scope :ldap, -> { joins(:identities).where('identities.provider LIKE ?', 'ldap%') }
scope :with_provider, ->(provider) do scope :with_provider, ->(provider) do
joins(:identities).where(identities: { provider: provider }) joins(:identities).where(identities: { provider: provider })
end end
=======
>>>>>>> upstream/master
scope :order_recent_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'DESC')) } scope :order_recent_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'DESC')) }
scope :order_oldest_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'ASC')) } scope :order_oldest_sign_in, -> { reorder(Gitlab::Database.nulls_last_order('current_sign_in_at', 'ASC')) }
scope :confirmed, -> { where.not(confirmed_at: nil) } scope :confirmed, -> { where.not(confirmed_at: nil) }
......
...@@ -378,21 +378,12 @@ describe User do ...@@ -378,21 +378,12 @@ describe User do
context 'when filtering by todo authors' do context 'when filtering by todo authors' do
let(:user1) { create(:user) } let(:user1) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
<<<<<<< HEAD
before do before do
create(:todo, user: user1, author: user1, state: :done) create(:todo, user: user1, author: user1, state: :done)
create(:todo, user: user2, author: user2, state: :pending) create(:todo, user: user2, author: user2, state: :pending)
end end
=======
before do
create(:todo, user: user1, author: user1, state: :done)
create(:todo, user: user2, author: user2, state: :pending)
end
>>>>>>> upstream/master
it 'only returns users that have authored todos' do it 'only returns users that have authored todos' do
users = described_class.limit_to_todo_authors( users = described_class.limit_to_todo_authors(
user: user2, user: user2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment