mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-08 00:23:01 +08:00
Fix global activities user selection dropdown [SCI-7402]
This commit is contained in:
parent
6e2224990b
commit
82d4b03cf6
1 changed files with 2 additions and 2 deletions
|
@ -403,7 +403,7 @@ class User < ApplicationRecord
|
|||
result = result.where.not(confirmed_at: nil) if active_only
|
||||
|
||||
if team_to_ignore.present?
|
||||
ignored_ids = UserTeam.select(:user_id).where(team_id: team_to_ignore.id)
|
||||
ignored_ids = UserAssignment.select(:user_id).where(assignable: team_to_ignore)
|
||||
result = result.where.not(users: { id: ignored_ids })
|
||||
end
|
||||
|
||||
|
@ -629,7 +629,7 @@ class User < ApplicationRecord
|
|||
query_teams = teams.pluck(:id)
|
||||
query_teams &= filters[:teams].map(&:to_i) if filters[:teams]
|
||||
query_teams &= User.team_by_subject(filters[:subjects]) if filters[:subjects]
|
||||
User.where(id: UserTeam.where(team_id: query_teams).select(:user_id))
|
||||
User.where(id: UserAssignment.where(assignable_id: query_teams, assignable_type: 'Team').select(:user_id))
|
||||
.search(false, search_query)
|
||||
.select(:full_name, :id)
|
||||
.map { |i| { label: escape_input(i[:full_name]), value: i[:id] } }
|
||||
|
|
Loading…
Reference in a new issue