File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
lib/ajax-datatables-rails/datatable Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -129,17 +129,10 @@ def non_regex_search
129
129
table [ field ] . send ( cond , value )
130
130
end
131
131
when :range
132
- if empty_range_search?
133
- nil
134
- else
135
- range_search
136
- end
132
+ return nil if empty_range_search?
133
+ range_search
137
134
when :null_value
138
- if search . value == '!NULL'
139
- table [ field ] . not_eq ( nil )
140
- else
141
- table [ field ] . eq ( nil )
142
- end
135
+ null_value_search
143
136
when :start_with
144
137
casted_column . matches ( "#{ value } %" )
145
138
when :end_with
@@ -185,6 +178,14 @@ def range_search
185
178
table [ field ] . between ( OpenStruct . new ( begin : new_start , end : new_end ) )
186
179
end
187
180
181
+ def null_value_search
182
+ if search . value == '!NULL'
183
+ table [ field ] . not_eq ( nil )
184
+ else
185
+ table [ field ] . eq ( nil )
186
+ end
187
+ end
188
+
188
189
end
189
190
end
190
191
end
You can’t perform that action at this time.
0 commit comments