diff options
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 9b0f1047b..92322f74f 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| @@ -919,10 +922,13 @@ public end # List of incoming messages to followup, by unique email - def who_can_followup_to + def who_can_followup_to(skip_message = nil) ret = [] done = {} for incoming_message in self.incoming_messages.reverse + if incoming_message == skip_message + next + end incoming_message.safe_mail_from email = OutgoingMailer.email_for_followup(self, incoming_message) |