Skip to content
This repository
Browse code

it should only no type casst is mass setting

  • Loading branch information...
commit 9a924b2a84dafec4e6b15a25fa236c7330a73ff6 1 parent 5a39981
Ben Johnson authored
2  lib/searchlogic/search.rb
@@ -189,7 +189,7 @@ def type_cast(value, type)
189 189
         when Range
190 190
           Range.new(type_cast(value.first, type), type_cast(value.last, type))
191 191
         else
192  
-          if ignore_value?(value)
  192
+          if setting_mass_conditions? && ignore_value?(value)
193 193
             value
194 194
           else
195 195
             # Let's leverage ActiveRecord's type casting, so that casting is consistent
6  spec/search_spec.rb
@@ -224,6 +224,12 @@
224 224
         search.id_nil.should == false
225 225
       end
226 226
       
  227
+      it "should be an Integer given ''" do
  228
+        search = User.search
  229
+        search.id_gt = ''
  230
+        search.id_gt.should == 0
  231
+      end
  232
+      
227 233
       it "should be an Integer given 1" do
228 234
         search = User.search
229 235
         search.id_gt = 1

0 notes on commit 9a924b2

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