lib/pg_search/features/dmetaphone.rb in pg_search-2.3.2 vs lib/pg_search/features/dmetaphone.rb in pg_search-2.3.3
- old
+ new
@@ -1,22 +1,20 @@
# frozen_string_literal: true
+require "active_support/core_ext/module/delegation"
+
module PgSearch
module Features
class DMetaphone
def initialize(query, options, columns, model, normalizer)
dmetaphone_normalizer = Normalizer.new(normalizer)
options = (options || {}).merge(dictionary: 'simple')
@tsearch = TSearch.new(query, options, columns, model, dmetaphone_normalizer)
end
- def conditions
- tsearch.conditions
- end
+ delegate :conditions, to: :tsearch
- def rank
- tsearch.rank
- end
+ delegate :rank, to: :tsearch
private
attr_reader :tsearch