aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlexey Poimtsev2012-01-17 15:54:30 +0400
committerAlexey Poimtsev2012-01-17 15:54:30 +0400
commit69127502f3a419beecd35dda687f5536524a4d7a (patch)
tree42a2fe5c1068b8ca054664d11523cded1a2c6238 /lib
parent6d444ac73749bd255892a888f3681c2d91405b53 (diff)
downloadinboxes-69127502f3a419beecd35dda687f5536524a4d7a.tar.bz2
acts_as_discussable
added acts_as_discussable method. this method can be used in any model to add ability on it
Diffstat (limited to 'lib')
-rw-r--r--lib/inboxes/active_record_extension.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/inboxes/active_record_extension.rb b/lib/inboxes/active_record_extension.rb
index 2a5bac8..d6e7e36 100644
--- a/lib/inboxes/active_record_extension.rb
+++ b/lib/inboxes/active_record_extension.rb
@@ -7,5 +7,9 @@ module Inboxes
has_many :speakers, :dependent => :destroy
has_many :discussions, :through => :speakers
end
+
+ def acts_as_discussable
+ has_many :discussions, :as => :discussable
+ end
end
-end \ No newline at end of file
+end