2005-04-03 10:52:05 +00:00
|
|
|
class Comment < ActiveRecord::Base
|
|
|
|
belongs_to :post
|
2005-07-22 20:05:42 +00:00
|
|
|
|
|
|
|
def self.what_are_you
|
|
|
|
'a comment...'
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.search_by_type(q)
|
|
|
|
self.find(:all, :conditions => ['type = ?', q])
|
|
|
|
end
|
2005-04-10 15:49:49 +00:00
|
|
|
end
|
|
|
|
|
2005-07-22 20:05:42 +00:00
|
|
|
class SpecialComment < Comment;
|
2005-07-03 08:21:22 +00:00
|
|
|
|
2005-07-22 20:05:42 +00:00
|
|
|
def self.what_are_you
|
|
|
|
'a special comment...'
|
|
|
|
end
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
class VerySpecialComment < Comment;
|
|
|
|
|
|
|
|
def self.what_are_you
|
|
|
|
'a very special comment...'
|
|
|
|
end
|
|
|
|
|
|
|
|
end;
|