Deleting clips will now correctly remove any dangling relations

This commit is contained in:
Roscoe 2025-09-10 04:18:47 +01:00
commit a17b169679
Signed by: RoscoeDaWah
SSH key fingerprint: SHA256:Hqn452XQ1ETzUt/FthJu6+OFkS4NBxCv5VQSEvuk7CE

View file

@ -1,7 +1,7 @@
class Clip < ApplicationRecord
has_one_attached :video
belongs_to :category
has_many :tag_to_clips
has_many :tag_to_clips, dependent: :destroy
has_many :tags, through: :tag_to_clips
validates :title, presence: true
end