Class: Symphonia::ModelFilters::StringFilter
- Defined in:
- lib/symphonia/model_filters/string_filter.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#caption, #name, #operator, #options, #query, #type, #value
Instance Method Summary collapse
Methods inherited from Base
#active?, #initialize, #inspect
Constructor Details
This class inherits a constructor from Symphonia::ModelFilters::Base
Instance Method Details
#apply(scope) ⇒ Object
5 6 7 8 9 |
# File 'lib/symphonia/model_filters/string_filter.rb', line 5 def apply(scope) super t = scope.arel_table scope.where(t[name].lower.send(operator, value&.downcase)) end |
#form_field(_c) ⇒ Object
11 12 13 |
# File 'lib/symphonia/model_filters/string_filter.rb', line 11 def form_field(_c) _c.text_field_tag(form_field_name, @query.active_filters[name], class: 'form-control') end |