This commit is contained in:
Toks
2014-08-23 19:41:44 -04:00
parent 0682a0db63
commit c5cabe4e58
2 changed files with 2 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ class ForumPost < ActiveRecord::Base
after_create :update_topic_updated_at_on_create
after_update :update_topic_updated_at_on_update_for_original_posts
after_destroy :update_topic_updated_at_on_destroy
validates_presence_of :body, :creator_id
validates_presence_of :body, :creator_id, :topic
validate :validate_topic_is_unlocked
before_destroy :validate_topic_is_unlocked
after_save :delete_topic_if_original_post