Merge pull request #676 from okriuchykhin/ok_SCI_1342

Fix search when viewing only assigned repository records [SCI-1342]
This commit is contained in:
okriuchykhin 2017-06-13 09:13:40 +02:00 committed by GitHub
commit d297a96e71

View file

@ -138,20 +138,23 @@ class RepositoryDatatable < AjaxDatatablesRails::Base
# after that "data" function will return json
def get_raw_records
repository_rows = RepositoryRow
.includes(
.preload(
:repository_columns,
:created_by
# repository_cells: :value
).references(
:repository_columns,
:created_by
:created_by,
repository_cells: :value
)
.joins(:created_by)
.where(repository: @repository)
if @my_module
@assigned_rows = @my_module
.repository_rows
.where(repository: @repository)
@assigned_rows = @my_module.repository_rows
.preload(
:repository_columns,
:created_by,
repository_cells: :value
)
.joins(:created_by)
.where(repository: @repository)
end
# Make mappings of custom columns, so we have same id for every column