ajax-datatables-rails
ajax-datatables-rails copied to clipboard
Integer only support
https://github.com/jbox-web/ajax-datatables-rails/blob/66e81baa3ca373248e706cc964f9adcc748e938d/lib/ajax-datatables-rails/datatable/column/search.rb#L63
Why such a harsh limitation? What about Float
comparison?
I monkey patched it locally and it works great. BTW, there are 3 casting, performance wise, save the first casting results and check against it.
def is_out_of_range?(search_value)
Float(search_value) > LARGEST_PQ_INTEGER || Float(search_value) < SMALLEST_PQ_INTEGER
end
def is_integer?(string)
true if Float(string) rescue false
end
Why such a harsh limitation? What about
Float
comparison?
https://github.com/jbox-web/ajax-datatables-rails/commit/192f5d3030e3dd021a4f5e3a5b124b516207f493 https://github.com/jbox-web/ajax-datatables-rails/pull/284
You're right.