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:
parent
ea83265b87
commit
5a23b8d5e5
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user