From 360f6c3e63530711b5a0d8559fb2614026f6a1d5 Mon Sep 17 00:00:00 2001 From: Akash Manohar J Date: Fri, 6 Apr 2012 04:08:33 +0530 Subject: [PATCH] Destroy the activities and attachments if the channel is destroyed Signed-off-by: Akash Manohar J --- app/models/channel.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/channel.rb b/app/models/channel.rb index 97703b96..4903dbbb 100644 --- a/app/models/channel.rb +++ b/app/models/channel.rb @@ -1,6 +1,6 @@ class Channel < ActiveRecord::Base - has_many :activities - has_many :attachments + has_many :activities, :dependent => :destroy + has_many :attachments, :dependent => :destroy class << self def user_connect(user)