class Post < ActiveRecord::Base ## # Validations # validates :body, :presence => true validates :title, :presence => true ## # Associations # belongs_to :favorite_comment, :class_name => "Comment" belongs_to :typus_user has_and_belongs_to_many :categories has_many :comments has_many :views ## # Class Methods # def self.status { "Draft" => "draft", "Published" => "published", "Unpublished" => "unpublished", "