diff options
-rw-r--r-- | app/models/public_body.rb | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index bc6f7bf2c..61e293918 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -269,19 +269,6 @@ class PublicBody < ActiveRecord::Base "authority" end - # if the URL name has changed, then all requested_from: queries - # will break unless we update index for every event for every - # request linked to it - def reindex_requested_from - if changes.include?('url_name') - info_requests.each do |info_request| - info_request.info_request_events.each do |info_request_event| - info_request_event.xapian_mark_needs_index - end - end - end - end - # Guess home page from the request email, or use explicit override, or nil # if not known. def calculated_home_page @@ -716,6 +703,25 @@ class PublicBody < ActiveRecord::Base self.publication_scheme = "" if publication_scheme.nil? end + # if the URL name has changed, then all requested_from: queries + # will break unless we update index for every event for every + # request linked to it + # + # TODO: Can't actually deprecate this because spec/script/mailin_spec.rb:28 + # fails due to the deprecation notice output + def reindex_requested_from + # warn %q([DEPRECATION] PublicBody#reindex_requested_from will become a + # private method in 0.23).squish + + if changes.include?('url_name') + info_requests.each do |info_request| + info_request.info_request_events.each do |info_request_event| + info_request_event.xapian_mark_needs_index + end + end + end + end + # Methods to remove # -------------------------------------------------------------------------- |