lib/pg_search/features/dmetaphone.rb in pg_search-0.5.1 vs lib/pg_search/features/dmetaphone.rb in pg_search-0.5.2
- old
+ new
@@ -1,16 +1,19 @@
-require "active_support/core_ext/module/delegation"
-
module PgSearch
module Features
class DMetaphone
- delegate :conditions, :rank, :to => :'@tsearch'
-
- # config is temporary as we refactor
- def initialize(query, options, config, model, normalizer)
+ def initialize(query, options, columns, model, normalizer)
dmetaphone_normalizer = Normalizer.new(normalizer)
options = (options || {}).merge(:dictionary => 'simple')
- @tsearch = TSearch.new(query, options, config, model, dmetaphone_normalizer)
+ @tsearch = TSearch.new(query, options, columns, model, dmetaphone_normalizer)
+ end
+
+ def conditions
+ @tsearch.conditions
+ end
+
+ def rank
+ @tsearch.rank
end
# Decorates a normalizer with dmetaphone processing.
class Normalizer
def initialize(normalizer_to_wrap)