From fccaacf2389cbf6514b5bf608deffe77e9ec01f5 Mon Sep 17 00:00:00 2001 From: Piotr Janik Date: Wed, 2 Jul 2014 22:12:23 +0100 Subject: [PATCH] Make sure that template materials aren't displayed in Search results [#69955036] --- lib/activity_runtime_api.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/activity_runtime_api.rb b/lib/activity_runtime_api.rb index bc6f1608bf..e660da4bc0 100644 --- a/lib/activity_runtime_api.rb +++ b/lib/activity_runtime_api.rb @@ -55,6 +55,11 @@ def self.publish_activity(hash, user) # update activity so external_activity.template is correctly initialzed # otherwise external_activity.template.is_template? won't be true activity.reload + # then reindex it manually, so Solr has correct value of :is_template attribute + Sunspot.index(activity) + # exactly the same applies to invesigation template + investigation.reload + Sunspot.index(investigation) end return external_activity @@ -132,6 +137,8 @@ def self.publish_sequence(hash, user) # update investigation so external_activity.template is correctly initialzed # otherwise external_activity.template.is_template? won't be true investigation.reload + # then reindex it manually, so Solr has correct value of :is_template attribute + Sunspot.index(investigation) end return external_activity end