Sha256: 87eb6efbb174c4f924e899ec50f9cdbafa111ef4d865fde977acff9f799c0387
Contents?: true
Size: 609 Bytes
Versions: 7
Compression:
Stored size: 609 Bytes
Contents
module PgSearch class Normalizer def initialize(config) @config = config end def add_normalization(original_sql) normalized_sql = original_sql if @config.ignore.include?(:accents) if @config.postgresql_version < 90000 raise PgSearch::NotSupportedForPostgresqlVersion.new(<<-MESSAGE.gsub /^\s*/, '') Sorry, {:ignoring => :accents} only works in PostgreSQL 9.0 and above. #{@config.inspect} MESSAGE else normalized_sql = "unaccent(#{normalized_sql})" end end normalized_sql end end end
Version data entries
7 entries across 7 versions & 1 rubygems