Skip to content
Browse files

Ignore blank values when taking action

  • Loading branch information...
1 parent 1f27586 commit 94460f3c345dcb1c29edf36cdde5521a88098f3c @binarylogic binarylogic committed
Showing with 7 additions and 1 deletion.
  1. +1 −1 lib/searchlogic/search.rb
  2. +6 −0 spec/search_spec.rb
View
2 lib/searchlogic/search.rb
@@ -126,7 +126,7 @@ def method_missing(name, *args, &block)
# This is here as a hook to allow people to modify the order in which the conditions are called, for whatever reason.
def conditions_array
- conditions.to_a
+ @conditions.to_a
end
def normalize_scope_name(scope_name)
View
6 spec/search_spec.rb
@@ -380,6 +380,12 @@
s.created_at_after = Time.now
lambda { s.count }.should_not raise_error
end
+
+ it "should not include blank values" do
+ s = User.search
+ s.conditions = {"id_equals" => ""}
+ s.proxy_options.should == {}
+ end
end
context "method delegation" do

0 comments on commit 94460f3

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