11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/commentable_model.rb', line 11
def
return if
has_many :posts, :order => 'posts.created_at ASC', :dependent => :destroy
belongs_to :replied_by, :class_name => 'Reader' if column_names.include? 'replied_by_id'
class_eval {
extend CommentableModel::CommentableClassMethods
include CommentableModel::CommentableInstanceMethods
}
named_scope :last_commented, lambda { |count| {
:conditions => "replied_at IS NOT NULL",
:order => "replied_at DESC",
:limit => count
}}
end
|