aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-09-02 18:04:12 +0100
committerGareth Rees <gareth@mysociety.org>2014-09-12 17:17:17 +0100
commitcee0aec2cdb3f07c6d8eeaed9ee3c7111935ac68 (patch)
tree15b934df6cbc6352541fb16321e36d437751d066 /app/models
parentfc1a27bfb306b189a4b4d936131d8cbc4d1f351e (diff)
Add correct validations to CensorRule
Diffstat (limited to 'app/models')
-rw-r--r--app/models/censor_rule.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/censor_rule.rb b/app/models/censor_rule.rb
index 3c5c77563..62cf8112f 100644
--- a/app/models/censor_rule.rb
+++ b/app/models/censor_rule.rb
@@ -30,7 +30,11 @@ class CensorRule < ActiveRecord::Base
attr_accessor :allow_global
validate :require_user_request_or_public_body, :unless => proc{ |rule| rule.allow_global == true }
validate :require_valid_regexp, :if => proc{ |rule| rule.regexp? == true }
- validates_presence_of :text
+
+ validates_presence_of :text,
+ :replacement,
+ :last_edit_comment,
+ :last_edit_editor
scope :global, {:conditions => {:info_request_id => nil,
:user_id => nil,