Module: LoudmouthExtension::ClassMethods

Defined in:
lib/extensions/active_record.rb

Instance Method Summary collapse

Instance Method Details

#loudmouths_can_comment(options = {}) ⇒ Object



7
8
9
10
11
# File 'lib/extensions/active_record.rb', line 7

def loudmouths_can_comment(options = {})
  has_many :comments, :class_name => "#{self.name}Comment", :include => [ :author ], 
                :dependent => :destroy, :order => 'created_at DESC'
  send :include, InstanceMethods
end