lib/pg_search/features/dmetaphone.rb in pg_search-0.6.0 vs lib/pg_search/features/dmetaphone.rb in pg_search-0.6.1

- old
+ new

@@ -24,11 +24,17 @@ def initialize(normalizer_to_wrap) @normalizer_to_wrap = normalizer_to_wrap end def add_normalization(original_sql) - otherwise_normalized_sql = normalizer_to_wrap.add_normalization(original_sql) - "pg_search_dmetaphone(#{otherwise_normalized_sql})" + otherwise_normalized_sql = Arel.sql( + normalizer_to_wrap.add_normalization(original_sql) + ) + + Arel::Nodes::NamedFunction.new( + "pg_search_dmetaphone", + [otherwise_normalized_sql] + ).to_sql end private attr_reader :normalizer_to_wrap