This commit is contained in:
r888888888
2013-04-19 15:35:36 -07:00
parent a7b6dd6de0
commit d2f2a142b9
2 changed files with 9 additions and 3 deletions

View File

@@ -26,9 +26,9 @@ class Post < ActiveRecord::Base
has_many :versions, :class_name => "PostVersion", :dependent => :destroy, :order => "post_versions.id ASC"
has_many :votes, :class_name => "PostVote", :dependent => :destroy
has_many :notes, :dependent => :destroy
has_many :comments, :order => "comments.id"
has_many :comments, :order => "comments.id", :dependent => :destroy
has_many :children, :class_name => "Post", :foreign_key => "parent_id", :order => "posts.id"
has_many :disapprovals, :class_name => "PostDisapproval"
has_many :disapprovals, :class_name => "PostDisapproval", :dependent => :destroy
validates_uniqueness_of :md5
validates_presence_of :parent, :if => lambda {|rec| !rec.parent_id.nil?}
attr_accessible :source, :rating, :tag_string, :old_tag_string, :last_noted_at, :parent_id, :as => [:member, :builder, :privileged, :platinum, :contributor, :janitor, :moderator, :admin, :default]