diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-04-27 16:19:21 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-04-27 16:19:21 +0100 |
commit | d030a32a6acf3def64bc35f9fc3cb59db122f3fd (patch) | |
tree | a277d6664a1282c20bc88d984f98342dcd4e63af /app/models | |
parent | eefd59e308e2d5e1fb5a211811c41cc5adc0a81d (diff) | |
parent | fc573c98372146e4fc7546c7e65cc4719e74205a (diff) |
Merge branch 'hotfix/0.21.0.23' into rails-3-develop
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 7f6b358db..57a8fd7e0 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 |