mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-24 15:54:00 +08:00
Hide archived and not assigned items from the assigning screen on the task
This commit is contained in:
parent
3f309832fc
commit
bdf959db1f
1 changed files with 11 additions and 6 deletions
|
@ -38,12 +38,17 @@ class RepositoryDatatableService
|
|||
repository_rows = repository_rows.joins(:my_module_repository_rows)
|
||||
.where(my_module_repository_rows: { my_module_id: @my_module })
|
||||
else
|
||||
repository_rows = repository_rows.joins(
|
||||
'LEFT OUTER JOIN "my_module_repository_rows" '\
|
||||
'ON "my_module_repository_rows"."repository_row_id" = "repository_rows"."id" '\
|
||||
'AND "my_module_repository_rows"."my_module_id" = ' + @my_module.id.to_s
|
||||
).select('CASE WHEN my_module_repository_rows.id IS NOT NULL '\
|
||||
'THEN true ELSE false END as row_assigned').group('my_module_repository_rows.id')
|
||||
repository_rows = repository_rows
|
||||
.joins(:repository)
|
||||
.joins('LEFT OUTER JOIN "my_module_repository_rows" '\
|
||||
'ON "my_module_repository_rows"."repository_row_id" = "repository_rows"."id" '\
|
||||
'AND "my_module_repository_rows"."my_module_id" = ' + @my_module.id.to_s)
|
||||
.select('CASE WHEN my_module_repository_rows.id IS NOT NULL '\
|
||||
'THEN true ELSE false END as row_assigned')
|
||||
.where('my_module_repository_rows.id IS NOT NULL
|
||||
OR (repository_rows.archived = FALSE
|
||||
AND repositories.archived = FALSE)')
|
||||
.group('my_module_repository_rows.id')
|
||||
end
|
||||
end
|
||||
repository_rows = repository_rows
|
||||
|
|
Loading…
Reference in a new issue