Sha256: d0239027350320bae6a7f3b1accc80c1bd7f007409268bade1bd7d56f7fcda63
Contents?: true
Size: 599 Bytes
Versions: 12
Compression:
Stored size: 599 Bytes
Contents
# frozen_string_literal: true module PgSearch class Normalizer def initialize(config) @config = config end def add_normalization(sql_expression) return sql_expression unless config.ignore.include?(:accents) sql_node = case sql_expression when Arel::Nodes::Node sql_expression else Arel.sql(sql_expression) end Arel::Nodes::NamedFunction.new( PgSearch.unaccent_function, [sql_node] ).to_sql end private attr_reader :config end end
Version data entries
12 entries across 12 versions & 1 rubygems