Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #260: Don't add filter if without_ids is empty

  • Loading branch information...
commit 1566b1241ecd9ee338829bd1ff3812246033a7b4 1 parent 4ca4e28
@jrust authored
View
2  lib/thinking_sphinx/search.rb
@@ -718,7 +718,7 @@ def internal_filters
filters << Riddle::Client::Filter.new(
'sphinx_internal_id', filter_value(options[:without_ids]), true
- ) if options[:without_ids]
+ ) if options[:without_ids].present?
filters
end
View
7 spec/thinking_sphinx/search_spec.rb
@@ -636,6 +636,13 @@
filter.attribute.should == 'sphinx_internal_id'
filter.exclude?.should be_true
end
+
+ it "should not filter out any ids if :without_ids is an empty array" do
+ ThinkingSphinx::Search.new(:without_ids => []).first
+
+ filter = @client.filters.last
+ filter.attribute.should_not == 'sphinx_internal_id'
+ end
end
describe 'sort mode' do
Please sign in to comment.
Something went wrong with that request. Please try again.