Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Exclude business support editions from search

We don't intend these to be found through search.
  • Loading branch information...
commit 9dee00a5a0a853db6adaa2c918025ef1bf0eb33d 1 parent e83aeaf
James Stewart jystewart authored
4 app/models/rummageable_artefact.rb
... ... @@ -1,5 +1,7 @@
1 1 class RummageableArtefact
2 2
  3 + FORMATS_NOT_TO_INDEX = %W(business_support)
  4 +
3 5 def initialize(artefact)
4 6 @artefact = artefact
5 7 end
@@ -9,7 +11,7 @@ def logger
9 11 end
10 12
11 13 def should_be_indexed?
12   - @artefact.live?
  14 + @artefact.live? && ! FORMATS_NOT_TO_INDEX.include?(@artefact.kind)
13 15 end
14 16
15 17 def submit
9 test/unit/rummageable_artefact_test.rb
@@ -123,4 +123,13 @@ class RummageableArtefactTest < ActiveSupport::TestCase
123 123
124 124 assert RummageableArtefact.new(artefact).should_be_indexed?
125 125 end
  126 +
  127 + test "should not index business support content" do
  128 + artefact = Artefact.new do |artefact|
  129 + artefact.state = "live"
  130 + artefact.kind = "business_support"
  131 + end
  132 +
  133 + refute RummageableArtefact.new(artefact).should_be_indexed?
  134 + end
126 135 end

0 comments on commit 9dee00a

Please sign in to comment.
Something went wrong with that request. Please try again.