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

@@ -7,6 +7,7 @@ class BulkUpdateRequest < ActiveRecord::Base
validates_presence_of :user
validates_presence_of :script
validates_presence_of :title
validates_presence_of :forum_topic, :message => "is invalid"
validates_inclusion_of :status, :in => %w(pending approved rejected)
validate :script_formatted_correctly
attr_accessible :user_id, :forum_topic_id, :script, :title, :reason

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