diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-04-27 16:18:33 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-04-27 16:18:33 +0100 |
commit | 2f2415d8d126423c17dd85d29f8fb543b56b946d (patch) | |
tree | 2badecc581befa352b54c40278e84cd4847096bb /app/models | |
parent | 0b91fc3469f6110abc9506ef70b625d1ad9bf4f2 (diff) | |
parent | fc573c98372146e4fc7546c7e65cc4719e74205a (diff) |
Merge branch 'hotfix/0.21.0.23'0.21.0.23
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/info_request.rb | 7 | ||||
-rw-r--r-- | app/models/outgoing_message.rb | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index fd42ccd9c..245de1e15 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -803,11 +803,8 @@ public # Text from the the initial request, for use in summary display def initial_request_text - if outgoing_messages.empty? # mainly for use with incomplete fixtures - return "" - end - excerpt = self.outgoing_messages[0].get_text_for_indexing - return excerpt + return '' if outgoing_messages.empty? # mainly for use with incomplete fixtures + outgoing_messages.first.get_text_for_indexing end # Returns index of last event which is described or nil if none described. diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index fa83c7381..c2c8ef4f2 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -302,7 +302,7 @@ class OutgoingMessage < ActiveRecord::Base end def set_default_letter - self.body = get_default_message if body.nil? + self.body = get_default_message if raw_body.nil? end def format_of_body |