aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2015-06-03 17:55:00 +0100
committerGareth Rees <gareth@mysociety.org>2015-06-15 16:11:12 +0100
commitc442a780f98bb698ce0d2d8202d36ced7cf48af4 (patch)
treecf5116b4ac10d3b913d1a2bead97ab4b425ffa02
parentc65e447b60893872fc8531313c73bdc27cbfb5a0 (diff)
Privatise PublicBody#reindex_requested_from
Only used in a callback
-rw-r--r--app/models/public_body.rb32
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
# --------------------------------------------------------------------------