aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorAlexey Poimtsev2012-01-17 15:42:46 +0400
committerAlexey Poimtsev2012-01-17 15:42:46 +0400
commit6d444ac73749bd255892a888f3681c2d91405b53 (patch)
tree5748e935d11c90a4385a86f3e72287005c9209b2 /app
parentbbde9b7d0fc69d738634e47afd5925b1515cf9ee (diff)
downloadinboxes-6d444ac73749bd255892a888f3681c2d91405b53.tar.bz2
Added ability to attach discussion to any other model (discussable)
Diffstat (limited to 'app')
-rw-r--r--app/models/discussion.rb2
1 files changed, 2 insertions, 0 deletions
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