From ef3cd2c6adbc210b253d155ed4274ee5551a590e Mon Sep 17 00:00:00 2001 From: francis Date: Mon, 19 Oct 2009 22:20:48 +0000 Subject: Require mixed capitals for headings too. --- app/models/info_request.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 71722b454..f57ee7099 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -24,7 +24,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.213 2009-10-04 21:53:54 francis Exp $ +# $Id: info_request.rb,v 1.214 2009-10-19 22:20:48 francis Exp $ require 'digest/sha1' require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian') @@ -89,6 +89,12 @@ class InfoRequest < ActiveRecord::Base 'holding_pen', # put them in the holding pen 'blackhole' # just dump them ] + + def validate + if !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 + end OLD_AGE_IN_DAYS = 21.days -- cgit v1.2.3