mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-23 15:24:57 +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])
|
query = query.where('project_id IN (?)', subjects_with_children[:Project])
|
||||||
subjects_with_children.except!(:Project)
|
subjects_with_children.except!(:Project)
|
||||||
end
|
end
|
||||||
query = query.where(
|
where_condition = subjects_with_children.map { '(subject_type = ? AND subject_id IN(?))' }.join(' OR ')
|
||||||
subjects_with_children.map { '(subject_type = ? AND subject_id IN(?))' }.join(' OR '),
|
where_arguments = subjects_with_children.flatten
|
||||||
*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
|
end
|
||||||
|
|
||||||
query = query.where(owner_id: filters[:users]) if filters[:users]
|
query = query.where(owner_id: filters[:users]) if filters[:users]
|
||||||
|
|
Loading…
Reference in a new issue