Permalink
Browse files

Filtering timestamps fields by blank or present generates a query err…

…or (on Postgres at least). They should be filtered by null.

Enable to filter null timestamps
  • Loading branch information...
1 parent 6810a1e commit 100a29edc6cae4a84710491a55939f58161ddc16 @jbescoyez jbescoyez committed Sep 28, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/assets/javascripts/rails_admin/ra.filter-box.js
View
4 app/assets/javascripts/rails_admin/ra.filter-box.js
@@ -29,8 +29,8 @@
'<option data-additional-fieldset="true" ' + (field_operator == "less_than" ? 'selected="selected"' : '') + ' value="less_than">Less than ... days ago</option>' +
'<option data-additional-fieldset="true" ' + (field_operator == "more_than" ? 'selected="selected"' : '') + ' value="more_than">More than ... days ago</option>' +
'<option disabled="disabled">---------</option>' +
- '<option data-additional-fieldset="false"' + (field_operator == "_present" ? 'selected="selected"' : '') + ' value="_present">Is present</option>' +
- '<option data-additional-fieldset="false"' + (field_operator == "_blank" ? 'selected="selected"' : '') + ' value="_blank" >Is blank</option>' +
+ '<option data-additional-fieldset="false"' + (field_operator == "_not_null" ? 'selected="selected"' : '') + ' value="_not_null">Is not null</option>' +
+ '<option data-additional-fieldset="false"' + (field_operator == "_null" ? 'selected="selected"' : '') + ' value="_null" >Is null</option>' +
'</select>' +
'<input class="additional-fieldset text_field" style="display:' + (field_operator == "less_than" || field_operator == "more_than" ? 'block' : 'none') + ';" type="text" name="' + value_name + '" value="' + field_value + '" /> ';
break;

0 comments on commit 100a29e

Please sign in to comment.