aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2009-12-18 01:21:35 +0000
committerFrancis Irving <francis@mysociety.org>2009-12-18 01:21:35 +0000
commit94c474b6056441009ac11cd5b444f11e8bd05380 (patch)
treed44442b17bf36343137c47594091c7e52330ca2a /app/models/info_request.rb
parentfcfa755f02f1ccd388566b5b60e7c2ef717cdd7d (diff)
Limit maximum length of titles.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index fae8441db..8ff58120b 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -95,6 +95,9 @@ class InfoRequest < ActiveRecord::Base
if !self.title.nil? && !MySociety::Validate.uses_mixed_capitals(self.title, 10)
errors.add(:title, '^Please write the summary using a mixture of capital and lower case letters. This makes it easier for others to read.')
end
+ if !self.title.nil? && title.size > 200
+ errors.add(:title, '^Please keep the summary short, like in the subject of an email. You can use a phrase, rather than a full sentence.')
+ end
end
OLD_AGE_IN_DAYS = 21.days