Remove topic links when a post is deleted

This commit is contained in:
Neil Lalonde
2013-06-13 13:41:45 -04:00
parent 49c09898e2
commit 4db8204a15
5 changed files with 57 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ class TopicLink < ActiveRecord::Base
validates_uniqueness_of :url, scope: [:topic_id, :post_id]
has_many :topic_link_clicks
has_many :topic_link_clicks, dependent: :destroy
validate :link_to_self