Class: Huginn::Searchable::Fuzzy::Unaccent
- Inherits:
-
Object
- Object
- Huginn::Searchable::Fuzzy::Unaccent
- Includes:
- Unaccentable
- Defined in:
- lib/huginn/searchable/fuzzy.rb
Instance Method Summary collapse
-
#initialize(column, value) ⇒ Unaccent
constructor
A new instance of Unaccent.
- #predicate ⇒ Object
Constructor Details
#initialize(column, value) ⇒ Unaccent
Returns a new instance of Unaccent.
55 56 57 58 |
# File 'lib/huginn/searchable/fuzzy.rb', line 55 def initialize(column, value) @column = column @value = value end |
Instance Method Details
#predicate ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/huginn/searchable/fuzzy.rb', line 60 def predicate Arel::Nodes::InfixOperation.new( "ILIKE", unaccent(@column), unaccent(Arel::Nodes.build_quoted("%#{escape_like(@value)}%", @column)) ) end |