aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-09-05 12:32:17 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-09-05 12:32:17 +0100
commit7f0ae82d44873b53cc87c659b42415ce4866c7b4 (patch)
treefdce14b0658bb05aef087dd4e09dc25c9a79ea8c /app/models/info_request.rb
parent2926ee877bcf8974c529e1271ded42971fe0d632 (diff)
parent96c4dd912083edcd0c9eda76bd2301bb4a1a6d53 (diff)
Merge branch 'develop' of github.com:sebbacon/alaveteli into develop, fix conflicts
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r--app/models/info_request.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 9b0f1047b..88a02cc2c 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -117,13 +117,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, N_('Please write the summary using a mixture of capital and lower case letters. This makes it easier for others to read.'))
+ 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, N_('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, _('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, 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.'))
+ 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.'))
end
end
@@ -780,8 +780,7 @@ public
# Display version of status
- def display_status
- status = self.calculate_status
+ def InfoRequest.get_status_description(status)
if status == 'waiting_classification'
_("Awaiting classification.")
elsif status == 'waiting_response'
@@ -819,6 +818,10 @@ public
end
end
+ def display_status
+ InfoRequest.get_status_description(self.calculate_status)
+ end
+
# Completely delete this request and all objects depending on it
def fully_destroy
self.track_things.each do |track_thing|