From 6d444ac73749bd255892a888f3681c2d91405b53 Mon Sep 17 00:00:00 2001 From: Alexey Poimtsev Date: Tue, 17 Jan 2012 15:42:46 +0400 Subject: Added ability to attach discussion to any other model (discussable) --- app/models/discussion.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/models/discussion.rb b/app/models/discussion.rb index a5b12ca..675547d 100644 --- a/app/models/discussion.rb +++ b/app/models/discussion.rb @@ -7,6 +7,8 @@ class Discussion < ActiveRecord::Base # creater has_many :messages, :dependent => :destroy + belongs_to :discussable, :polymorphic => true + # participants of discussion (speakers) has_many :speakers, :dependent => :destroy has_many :users, :through => :speakers -- cgit v1.2.3