aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/outgoing_message.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-08-18 20:51:25 +0000
committerfrancis <francis>2009-08-18 20:51:25 +0000
commit32c1fe80dc3fefc85d27a8465b67084fbd4fe60e (patch)
tree919a1bfef9b8098a04af19cab111cdf10fe32bfb /app/models/outgoing_message.rb
parentb7e060461e986a5bedb4c018b44ae3f1f34d7f11 (diff)
Don't allow duplicate followup messages to the same request.
Prevent requests, followups and annotations which have all capitals or all lowercase letters.
Diffstat (limited to 'app/models/outgoing_message.rb')
-rw-r--r--app/models/outgoing_message.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index 6d1900d64..28701185a 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -22,7 +22,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: outgoing_message.rb,v 1.87 2009-07-21 12:09:30 francis Exp $
+# $Id: outgoing_message.rb,v 1.88 2009-08-18 20:51:26 francis Exp $
class OutgoingMessage < ActiveRecord::Base
strip_attributes!
@@ -129,8 +129,10 @@ class OutgoingMessage < ActiveRecord::Base
if self.body =~ /#{get_signoff}\s*\Z/ms
errors.add(:body, '^Please sign at the bottom with your name, or alter the "' + get_signoff + '" signature')
end
+ if !MySociety::Validate.uses_mixed_capitals(self.body)
+ errors.add(:body, '^Please write your message using a mixture of capital and lower case letters. This makes it easier for others to read.')
+ end
if self.what_doing.nil? || !['new_information', 'internal_review', 'normal_sort'].include?(self.what_doing)
-
errors.add(:what_doing_dummy, '^Please choose what sort of reply you are making.')
end
end