Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Exclude business support editions from search

We don't intend these to be found through search.
  • Loading branch information...
commit 9dee00a5a0a853db6adaa2c918025ef1bf0eb33d 1 parent e83aeaf
@jystewart jystewart authored
View
4 app/models/rummageable_artefact.rb
@@ -1,5 +1,7 @@
class RummageableArtefact
+ FORMATS_NOT_TO_INDEX = %W(business_support)
+
def initialize(artefact)
@artefact = artefact
end
@@ -9,7 +11,7 @@ def logger
end
def should_be_indexed?
- @artefact.live?
+ @artefact.live? && ! FORMATS_NOT_TO_INDEX.include?(@artefact.kind)
end
def submit
View
9 test/unit/rummageable_artefact_test.rb
@@ -123,4 +123,13 @@ class RummageableArtefactTest < ActiveSupport::TestCase
assert RummageableArtefact.new(artefact).should_be_indexed?
end
+
+ test "should not index business support content" do
+ artefact = Artefact.new do |artefact|
+ artefact.state = "live"
+ artefact.kind = "business_support"
+ end
+
+ refute RummageableArtefact.new(artefact).should_be_indexed?
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.