1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(bug) unable to remove supporting document type

This commit is contained in:
Du Peng 2023-07-27 17:47:22 +02:00
parent ea83265b87
commit 5a23b8d5e5
2 changed files with 4 additions and 4 deletions

View File

@ -2,8 +2,9 @@
# An admin can mark an uploaded document as refused, this will notify the member
class SupportingDocumentRefusal < ApplicationRecord
include NotificationAttachedObject
belongs_to :supportable, polymorphic: true
belongs_to :operator, class_name: 'User', inverse_of: :supporting_document_refusals
has_many :supporting_document_refusals_types, dependent: :destroy
has_many :supporting_document_types, through: :supporting_document_refusals_types
has_and_belongs_to_many :supporting_document_types
end

View File

@ -6,8 +6,7 @@ class SupportingDocumentType < ApplicationRecord
has_many :supporting_document_files, dependent: :destroy
has_many :supporting_document_refusals_types, dependent: :destroy
has_many :supporting_document_refusals, through: :supporting_document_refusals_types
has_and_belongs_to_many :supporting_document_refusals, dependent: :destroy
validates :document_type, presence: true, inclusion: { in: %w[User Child] }
end