Permalink
Browse files

it should only no type casst is mass setting

  • Loading branch information...
1 parent 5a39981 commit 9a924b2a84dafec4e6b15a25fa236c7330a73ff6 @binarylogic binarylogic committed Feb 3, 2010
Showing with 7 additions and 1 deletion.
  1. +1 −1 lib/searchlogic/search.rb
  2. +6 −0 spec/search_spec.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
@@ -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

0 comments on commit 9a924b2

Please sign in to comment.