2005-04-03 06:52:05 -04:00
|
|
|
class Comment < ActiveRecord::Base
|
2008-03-23 22:50:02 -04:00
|
|
|
named_scope :containing_the_letter_e, :conditions => "comments.body LIKE '%e%'"
|
|
|
|
|
2008-01-26 01:23:03 -05:00
|
|
|
belongs_to :post, :counter_cache => true
|
2008-01-18 02:27:03 -05:00
|
|
|
|
2005-07-22 16:05:42 -04:00
|
|
|
def self.what_are_you
|
|
|
|
'a comment...'
|
|
|
|
end
|
2008-01-18 02:27:03 -05:00
|
|
|
|
2005-07-22 16:05:42 -04:00
|
|
|
def self.search_by_type(q)
|
2005-11-16 03:16:54 -05:00
|
|
|
self.find(:all, :conditions => ["#{QUOTED_TYPE} = ?", q])
|
2005-07-22 16:05:42 -04:00
|
|
|
end
|
2005-04-10 11:49:49 -04:00
|
|
|
end
|
|
|
|
|
2005-11-04 14:39:50 -05:00
|
|
|
class SpecialComment < Comment
|
2005-07-22 16:05:42 -04:00
|
|
|
def self.what_are_you
|
|
|
|
'a special comment...'
|
|
|
|
end
|
2005-11-04 14:39:50 -05:00
|
|
|
end
|
2005-07-22 16:05:42 -04:00
|
|
|
|
2005-11-04 14:39:50 -05:00
|
|
|
class VerySpecialComment < Comment
|
2005-07-22 16:05:42 -04:00
|
|
|
def self.what_are_you
|
|
|
|
'a very special comment...'
|
|
|
|
end
|
2008-01-26 01:23:03 -05:00
|
|
|
end
|