Skip to content

Commit

Permalink
Remove unused behavior around facet_list_limit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed May 11, 2017
1 parent a9baa14 commit 52c403c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
4 changes: 1 addition & 3 deletions lib/blacklight/solr/search_builder_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ def add_facet_paging_to_solr(solr_params)
facet_ex = facet_config.respond_to?(:ex) ? facet_config.ex : nil
solr_params[:"facet.field"] = with_ex_local_param(facet_ex, facet_config.field)

limit = if scope.respond_to?(:facet_list_limit)
scope.facet_list_limit.to_s.to_i
elsif solr_params["facet.limit"]
limit = if solr_params["facet.limit"]
solr_params["facet.limit"].to_i
else
facet_config.fetch(:more_limit, 20)
Expand Down
13 changes: 0 additions & 13 deletions spec/models/blacklight/solr/search_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -639,19 +639,6 @@
expect(solr_parameters[:"f.#{facet_field}.facet.limit"]).to eq 21
end

context 'when facet_list_limit is defined in scope' do
before do
allow(context).to receive_messages facet_list_limit: 1000
end
it 'uses scope method for limit' do
expect(solr_parameters[:"f.#{facet_field}.facet.limit"]).to eq 1001
end

it 'uses controller method for limit when a ordinary limit is set' do
expect(solr_parameters[:"f.#{facet_field}.facet.limit"]).to eq 1001
end
end

it 'uses the default sort' do
expect(solr_parameters[:"f.#{facet_field}.facet.sort"]).to be_blank
end
Expand Down

0 comments on commit 52c403c

Please sign in to comment.