Merge pull request #7393 from artoscinote/ma_SCI_10551

Remove obsolete callback on RepositoryChecklistItemsValue [SCI-10551]
This commit is contained in:
Martin Artnik 2024-03-28 13:47:14 +01:00 committed by GitHub
commit 3369ec07ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,10 +5,4 @@ class RepositoryChecklistItemsValue < ApplicationRecord
belongs_to :repository_checklist_value, inverse_of: :repository_checklist_items_values
validates :repository_checklist_item, :repository_checklist_value, presence: true
after_destroy :destroy_empty_value
def destroy_empty_value
repository_checklist_value.destroy! if repository_checklist_value.repository_checklist_items_values.blank?
end
end