mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 03:59:51 +08:00
Include old activites assigned to the task [SCI-3285]
This commit is contained in:
parent
3a2f78d7a8
commit
01ffb43c23
1 changed files with 7 additions and 4 deletions
|
@ -13,10 +13,13 @@ class ActivitiesService
|
|||
query = query.where('project_id IN (?)', subjects_with_children[:Project])
|
||||
subjects_with_children.except!(:Project)
|
||||
end
|
||||
query = query.where(
|
||||
subjects_with_children.map { '(subject_type = ? AND subject_id IN(?))' }.join(' OR '),
|
||||
*subjects_with_children.flatten
|
||||
)
|
||||
where_condition = subjects_with_children.map { '(subject_type = ? AND subject_id IN(?))' }.join(' OR ')
|
||||
where_arguments = subjects_with_children.flatten
|
||||
if subjects_with_children[:MyModule]
|
||||
where_condition = where_condition.concat(' OR (my_module_id IN(?))')
|
||||
where_arguments << subjects_with_children[:MyModule]
|
||||
end
|
||||
query = query.where(where_condition, *where_arguments)
|
||||
end
|
||||
|
||||
query = query.where(owner_id: filters[:users]) if filters[:users]
|
||||
|
|
Loading…
Reference in a new issue