2005-04-03 10:52:05 +00:00
|
|
|
class Post < ActiveRecord::Base
|
2005-04-03 17:50:11 +00:00
|
|
|
belongs_to :author
|
2005-04-19 05:24:50 +00:00
|
|
|
has_many :comments, :order => "body"
|
2005-07-03 08:21:22 +00:00
|
|
|
has_one :very_special_comment, :class_name => "VerySpecialComment"
|
|
|
|
has_many :special_comments, :class_name => "SpecialComment"
|
2005-04-10 17:24:56 +00:00
|
|
|
has_and_belongs_to_many :categories
|
2005-07-03 08:21:22 +00:00
|
|
|
has_and_belongs_to_many :special_categories, :join_table => "categories_posts"
|
2005-07-22 20:05:42 +00:00
|
|
|
|
|
|
|
def self.what_are_you
|
|
|
|
'a post...'
|
|
|
|
end
|
2005-04-10 15:49:49 +00:00
|
|
|
end
|
|
|
|
|
2005-07-03 08:21:22 +00:00
|
|
|
class SpecialPost < Post; end;
|
|
|
|
|
|
|
|
class StiPost < Post
|
|
|
|
has_one :special_comment, :class_name => "SpecialComment"
|
|
|
|
end
|