mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-05 22:44:22 +08:00
Merge pull request #711 from okriuchykhin/ok_SCI_1415
Fix changing protocol ownership logic when removing user from the team [SCI-1415]
This commit is contained in:
commit
38724cf78e
1 changed files with 2 additions and 2 deletions
|
@ -59,8 +59,8 @@ class UserTeam < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# Also, make new owner author of all protocols that belong
|
||||
# to the departing user.
|
||||
p_ids = user.added_protocols.pluck(:id)
|
||||
# to the departing user and belong to this team.
|
||||
p_ids = user.added_protocols.where(team: team).pluck(:id)
|
||||
Protocol.find(p_ids).each do |protocol|
|
||||
protocol.record_timestamps = false
|
||||
protocol.added_by = new_owner
|
||||
|
|
Loading…
Reference in a new issue