diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-21 14:10:37 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-16 12:42:19 +0100 |
commit | ef17ef91cd3a7bf109a6a9e9c845e1bea6ea9edf (patch) | |
tree | 0fdee6324f4e2393ebff5bcd99283878765b6ca9 /app/models | |
parent | d65804b7d8d2138b4570b26449321e1a9bb847fb (diff) |
Move display text generation to outgoing message.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/outgoing_message.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 5bd5898f9..07bb2a8e4 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -208,11 +208,11 @@ class OutgoingMessage < ActiveRecord::Base end # Returns text for indexing / text display - def get_text_for_indexing + def get_text_for_indexing(strip_salutation=true) text = self.body.strip # Remove salutation - text.sub!(/Dear .+,/, "") + text.sub!(/Dear .+,/, "") if strip_salutation # Remove email addresses from display/index etc. self.remove_privacy_sensitive_things!(text) @@ -232,6 +232,12 @@ class OutgoingMessage < ActiveRecord::Base return text.html_safe end + # Return body for display as text + def get_body_for_text_display + get_text_for_indexing(strip_salutation=false) + end + + def fully_destroy ActiveRecord::Base.transaction do info_request_event = InfoRequestEvent.find_by_outgoing_message_id(self.id) |