Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

it should only no type casst is mass setting

  • Loading branch information...
commit 9a924b2a84dafec4e6b15a25fa236c7330a73ff6 1 parent 5a39981
@binarylogic binarylogic authored
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
@@ -189,7 +189,7 @@ def type_cast(value, type)
when Range
Range.new(type_cast(value.first, type), type_cast(value.last, type))
else
- if ignore_value?(value)
+ if setting_mass_conditions? && ignore_value?(value)
value
else
# Let's leverage ActiveRecord's type casting, so that casting is consistent
View
6 spec/search_spec.rb
@@ -224,6 +224,12 @@
search.id_nil.should == false
end
+ it "should be an Integer given ''" do
+ search = User.search
+ search.id_gt = ''
+ search.id_gt.should == 0
+ end
+
it "should be an Integer given 1" do
search = User.search
search.id_gt = 1
Please sign in to comment.
Something went wrong with that request. Please try again.