Sha256: 1b394dc213492e1dacb3c97ca6eb3c0b3e687d358885295bd5d81eac6fd4a018

Contents?: true

Size: 621 Bytes

Versions: 8

Compression:

Stored size: 621 Bytes

Contents

module PgSearch
  module Features
    class Feature
      delegate :connection, :quoted_table_name, :to => :'@model'

      def initialize(query, options, columns, model, normalizer)
        @query = query
        @options = options || {}
        @columns = columns
        @model = model
        @normalizer = normalizer
      end

      private

      attr_reader :query, :options, :columns, :model, :normalizer

      def document
        columns.map { |column| column.to_sql }.join(" || ' ' || ")
      end

      def normalize(expression)
        normalizer.add_normalization(expression)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pg_search-0.7.2 lib/pg_search/features/feature.rb
pg_search-0.7.1 lib/pg_search/features/feature.rb
pg_search-0.7.0 lib/pg_search/features/feature.rb
pg_search-0.6.4 lib/pg_search/features/feature.rb
pg_search-0.6.3 lib/pg_search/features/feature.rb
pg_search-0.6.2 lib/pg_search/features/feature.rb
pg_search-0.6.1 lib/pg_search/features/feature.rb
pg_search-0.6.0 lib/pg_search/features/feature.rb