diff --git a/app/models/repository_checklist_item.rb b/app/models/repository_checklist_item.rb index 7bf66000c..f25165bfd 100644 --- a/app/models/repository_checklist_item.rb +++ b/app/models/repository_checklist_item.rb @@ -11,5 +11,5 @@ class RepositoryChecklistItem < ApplicationRecord belongs_to :last_modified_by, foreign_key: 'last_modified_by_id', class_name: 'User', inverse_of: :modified_repository_checklist_types has_many :repository_checklist_items_values, dependent: :destroy - has_many :repository_checklist_values, through: :repository_checklist_items_values + has_many :repository_checklist_values, through: :repository_checklist_items_values, dependent: :destroy end diff --git a/app/serializers/repository_datatable/repository_list_value_serializer.rb b/app/serializers/repository_datatable/repository_list_value_serializer.rb index d47deb4d3..2631870e8 100644 --- a/app/serializers/repository_datatable/repository_list_value_serializer.rb +++ b/app/serializers/repository_datatable/repository_list_value_serializer.rb @@ -4,8 +4,8 @@ module RepositoryDatatable class RepositoryListValueSerializer < RepositoryBaseValueSerializer def value { - id: object.repository_list_item.id, - text: object.data + id: (object.repository_list_item&.id || ''), + text: (object.data || '') } end end