Sha256: 253551183c92258169fecac87c85d50d0098e50a40374355ded0a2fcbe0ef6ff

Contents?: true

Size: 579 Bytes

Versions: 34

Compression:

Stored size: 579 Bytes

Contents

require 'digest'

module PgSearch
  class Configuration
    class ForeignColumn < Column
      attr_reader :weight

      def initialize(column_name, weight, model, association)
        super(column_name, weight, model)
        @association = association
      end

      def alias
        Configuration.alias(@association.subselect_alias, @column_name)
      end

      private

      def expression
        "#{@association.subselect_alias}.#{self.alias}"
      end

      def table_name
        @connection.quote_table_name(@association.table_name)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
pg_search-0.7.2 lib/pg_search/configuration/foreign_column.rb
pg_search-0.7.1 lib/pg_search/configuration/foreign_column.rb
pg_search-0.7.0 lib/pg_search/configuration/foreign_column.rb
pg_search-0.6.4 lib/pg_search/configuration/foreign_column.rb
pg_search-0.6.3 lib/pg_search/configuration/foreign_column.rb
pg_search-0.6.2 lib/pg_search/configuration/foreign_column.rb
pg_search-0.6.1 lib/pg_search/configuration/foreign_column.rb
pg_search-0.6.0 lib/pg_search/configuration/foreign_column.rb
pg_search-0.5.7 lib/pg_search/configuration/foreign_column.rb
pg_search-0.5.6 lib/pg_search/configuration/foreign_column.rb
pg_search-0.5.5 lib/pg_search/configuration/foreign_column.rb
pg_search-0.5.4 lib/pg_search/configuration/foreign_column.rb
pg_search-0.5.3 lib/pg_search/configuration/foreign_column.rb
pg_search-0.5.2 lib/pg_search/configuration/foreign_column.rb