Skip to content

Commit

Permalink
CV2-4508: include unconfirmed items when add new team task (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy committed May 2, 2024
1 parent c7dd0c3 commit e83862d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/team_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def add_to_sources
end

def add_to_project_medias
ProjectMedia.where({ team_id: self.team_id, archived: CheckArchivedFlags::FlagCodes::NONE })
ProjectMedia.where({ team_id: self.team_id, archived: [CheckArchivedFlags::FlagCodes::NONE, CheckArchivedFlags::FlagCodes::UNCONFIRMED] })
.joins("LEFT JOIN annotations a ON a.annotation_type = 'task' AND a.annotated_type = 'ProjectMedia'
AND a.annotated_id = project_medias.id
AND task_team_task_id(a.annotation_type, a.data) = #{self.id}")
Expand Down
2 changes: 1 addition & 1 deletion test/models/team_task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def setup
Team.stubs(:current).returns(t)
Sidekiq::Testing.inline! do
pm = create_project_media team: t
pm2 = create_project_media team: t
pm2 = create_project_media team: t, archived: CheckArchivedFlags::FlagCodes::UNCONFIRMED
tt = create_team_task team_id: t.id, order: 2, description: 'Foo', options: [{ label: 'Foo' }]
tt2 = create_team_task team_id: t.id, order: 1, description: 'Foo2', options: [{ label: 'Foo2' }]
pm_tt = pm.annotations('task').select{|t| t.team_task_id == tt.id}.last
Expand Down

0 comments on commit e83862d

Please sign in to comment.