Module: AjaxDatatablesRails::Datatable::Column::Search
- Included in:
- AjaxDatatablesRails::Datatable::Column
- Defined in:
- lib/ajax-datatables-rails/datatable/column/search.rb
Constant Summary collapse
- SMALLEST_PQ_INTEGER =
-2_147_483_648
- LARGEST_PQ_INTEGER =
2_147_483_647
- NOT_NULL_VALUE =
'!NULL'
- EMPTY_VALUE =
''
Instance Method Summary collapse
- #cond ⇒ Object
- #filter ⇒ Object
- #search ⇒ Object
- #search_query ⇒ Object
- #searchable? ⇒ Boolean
- #searched? ⇒ Boolean
-
#use_regex? ⇒ Boolean
Add use_regex option to allow bypassing of regex search.
Instance Method Details
#cond ⇒ Object
17 18 19 |
# File 'lib/ajax-datatables-rails/datatable/column/search.rb', line 17 def cond @view_column.fetch(:cond, :like) end |
#filter ⇒ Object
21 22 23 |
# File 'lib/ajax-datatables-rails/datatable/column/search.rb', line 21 def filter @view_column[:cond].call(self, formatted_value) end |
#search ⇒ Object
25 26 27 |
# File 'lib/ajax-datatables-rails/datatable/column/search.rb', line 25 def search @search ||= SimpleSearch.new([:search]) end |
#search_query ⇒ Object
33 34 35 |
# File 'lib/ajax-datatables-rails/datatable/column/search.rb', line 33 def search_query search.regexp? ? regex_search : non_regex_search end |
#searchable? ⇒ Boolean
13 14 15 |
# File 'lib/ajax-datatables-rails/datatable/column/search.rb', line 13 def searchable? @view_column.fetch(:searchable, true) end |
#searched? ⇒ Boolean
29 30 31 |
# File 'lib/ajax-datatables-rails/datatable/column/search.rb', line 29 def searched? search.value.present? end |
#use_regex? ⇒ Boolean
Add use_regex option to allow bypassing of regex search
38 39 40 |
# File 'lib/ajax-datatables-rails/datatable/column/search.rb', line 38 def use_regex? @view_column.fetch(:use_regex, true) end |