make_commentable 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,11 @@ require 'version'
|
|
2
2
|
require 'active_record'
|
3
3
|
|
4
4
|
module Commentable
|
5
|
+
|
6
|
+
def self.included(base)
|
7
|
+
base.extend ClassMethods
|
8
|
+
end
|
9
|
+
|
5
10
|
module ClassMethods
|
6
11
|
def mark_as_commentable(options={})
|
7
12
|
has_many :comments, {:as => :commentable, :dependent => :destroy}.merge(options)
|