Skip to content

Commit 4fcc4a2

Browse files
author
philippmeissner
committed
catched invalid integer values; added empty-search fallback
1 parent 0a44131 commit 4fcc4a2

File tree

1 file changed

+9
-1
lines changed
  • lib/ajax-datatables-rails/datatable/column

1 file changed

+9
-1
lines changed

lib/ajax-datatables-rails/datatable/column/search.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,20 @@ def regex_search
5252
end
5353
end
5454

55+
def empty_search
56+
casted_column.matches("")
57+
end
58+
5559
def non_regex_search
5660
case cond
5761
when Proc
5862
filter
5963
when :eq, :not_eq, :lt, :gt, :lteq, :gteq, :in
60-
numeric_search
64+
if is_searchable_integer?
65+
empty_search
66+
else
67+
numeric_search
68+
end
6169
when :null_value
6270
null_value_search
6371
when :start_with

0 commit comments

Comments
 (0)