diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-03-09 14:58:30 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-03-09 14:58:30 +0000 |
commit | b4585af18e9c3a033f6cfe27213f0575af795a66 (patch) | |
tree | 996efa1487ac0d8cb7e4f53ee6478ad625b9d27d /app/models/info_request.rb | |
parent | 224b8a4ba3a24af91068505c7907724448a4096d (diff) | |
parent | 4cc2cf2a6d935adfd263ea4fd7791a6d84f704da (diff) |
merge from master (post-CSRF changes)
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 23d7c78c3..3441a73f7 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -32,8 +32,8 @@ require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/li class InfoRequest < ActiveRecord::Base strip_attributes! - validates_presence_of :title, :message => "^Please enter a summary of your request" - validates_format_of :title, :with => /[a-zA-Z]/, :message => "^Please write a summary with some text in it", :if => Proc.new { |info_request| !info_request.title.nil? && !info_request.title.empty? } + validates_presence_of :title, :message => N_("Please enter a summary of your request") + validates_format_of :title, :with => /[a-zA-Z]/, :message => N_("Please write a summary with some text in it"), :if => Proc.new { |info_request| !info_request.title.nil? && !info_request.title.empty? } belongs_to :user #validates_presence_of :user_id # breaks during construction of new ones :( @@ -95,13 +95,13 @@ class InfoRequest < ActiveRecord::Base # only check on create, so existing models with mixed case are allowed def validate_on_create 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.') + errors.add(:title, N_('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.') + errors.add(:title, N_('Please keep the summary short, like in the subject of an email. You can use a phrase, rather than a full sentence.')) end if !self.title.nil? && self.title =~ /^(FOI|Freedom of Information)\s*requests?$/i - errors.add(:title, '^Please describe more what the request is about in the subject. There is no need to say it is an FOI request, we add that on anyway.') + errors.add(:title, N_('Please describe more what the request is about in the subject. There is no need to say it is an FOI request, we add that on anyway.')) end end |