mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-02 13:12:13 +08:00
Fix AR preloading for repository table [SCI-4070]
This commit is contained in:
parent
3481b50796
commit
371f699a11
5 changed files with 8 additions and 6 deletions
|
@ -9,7 +9,9 @@ module RepositoryDatatableHelper
|
||||||
_team,
|
_team,
|
||||||
assigned_rows)
|
assigned_rows)
|
||||||
parsed_records = []
|
parsed_records = []
|
||||||
repository_rows.each do |record|
|
includes_json = { repository_cells: Extends::REPOSITORY_SEARCH_INCLUDES }
|
||||||
|
|
||||||
|
repository_rows.includes(includes_json).each do |record|
|
||||||
row = {
|
row = {
|
||||||
'DT_RowId': record.id,
|
'DT_RowId': record.id,
|
||||||
'1': assigned_row(record, assigned_rows),
|
'1': assigned_row(record, assigned_rows),
|
||||||
|
|
|
@ -7,7 +7,7 @@ module RepositoryDatatable
|
||||||
attributes :value, :value_type
|
attributes :value, :value_type
|
||||||
|
|
||||||
def value
|
def value
|
||||||
asset = object.value.asset
|
asset = object.repository_asset_value.asset
|
||||||
{
|
{
|
||||||
id: asset.id,
|
id: asset.id,
|
||||||
url: rails_blob_path(asset.file, disposition: 'attachment'),
|
url: rails_blob_path(asset.file, disposition: 'attachment'),
|
||||||
|
|
|
@ -5,7 +5,7 @@ module RepositoryDatatable
|
||||||
attributes :value, :value_type
|
attributes :value, :value_type
|
||||||
|
|
||||||
def value
|
def value
|
||||||
object.value.data
|
object.repository_list_value.data
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,8 +6,8 @@ module RepositoryDatatable
|
||||||
|
|
||||||
def value
|
def value
|
||||||
{
|
{
|
||||||
icon: object.value.repository_status_item.icon,
|
icon: object.repository_status_value.repository_status_item.icon,
|
||||||
status: object.value.repository_status_item.status
|
status: object.repository_status_value.repository_status_item.status
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ module RepositoryDatatable
|
||||||
attributes :value, :value_type
|
attributes :value, :value_type
|
||||||
|
|
||||||
def value
|
def value
|
||||||
object.value.data
|
object.repository_text_value.data
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue