mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-10 01:19:45 +08:00
Merge pull request #4599 from okriuchykhin/ok_SCI_7402
Fix global activities user selection dropdown [SCI-7402]
This commit is contained in:
commit
fc56cc4197
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
|
result = result.where.not(confirmed_at: nil) if active_only
|
||||||
|
|
||||||
if team_to_ignore.present?
|
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 })
|
result = result.where.not(users: { id: ignored_ids })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -629,7 +629,7 @@ class User < ApplicationRecord
|
||||||
query_teams = teams.pluck(:id)
|
query_teams = teams.pluck(:id)
|
||||||
query_teams &= filters[:teams].map(&:to_i) if filters[:teams]
|
query_teams &= filters[:teams].map(&:to_i) if filters[:teams]
|
||||||
query_teams &= User.team_by_subject(filters[:subjects]) if filters[:subjects]
|
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)
|
.search(false, search_query)
|
||||||
.select(:full_name, :id)
|
.select(:full_name, :id)
|
||||||
.map { |i| { label: escape_input(i[:full_name]), value: i[:id] } }
|
.map { |i| { label: escape_input(i[:full_name]), value: i[:id] } }
|
||||||
|
|
Loading…
Reference in a new issue