Class: SnFilterable::Filterable::WhereHelper
- Inherits:
-
Object
- Object
- SnFilterable::Filterable::WhereHelper
- Defined in:
- lib/sn_filterable/filterable.rb
Overview
Helper class for generating ‘WHERE` conditions
Class Method Summary collapse
-
.contains(column_key, value) ⇒ Object
Helper to find if a value exists in a string (case-insensitive).
Class Method Details
.contains(column_key, value) ⇒ Object
Helper to find if a value exists in a string (case-insensitive)
237 238 239 |
# File 'lib/sn_filterable/filterable.rb', line 237 def self.contains(column_key, value) ["strpos(LOWER(#{column_key}), ?) > 0", value.downcase.strip] end |