diff options
Diffstat (limited to 'app/models/outgoing_message.rb')
-rw-r--r-- | app/models/outgoing_message.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 0700857d8..40abe0b0f 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -39,6 +39,16 @@ class OutgoingMessage < ActiveRecord::Base # contact address changed has_many :info_request_events + # reindex if body text is edited (e.g. by admin interface) + after_update :xapian_reindex_after_update + def xapian_reindex_after_update + if self.changes.include?('body') + for info_request_event in self.info_request_events + info_request_event.xapian_mark_needs_index + end + end + end + # How the default letter starts and ends def get_salutation ret = "Dear " |