Sha256: eb948058e49ffb9ee25d80bb0b56d1d009a862d0888bb670cb9b250bbfc3117e
Contents?: true
Size: 782 Bytes
Versions: 7
Compression:
Stored size: 782 Bytes
Contents
require 'digest' module PgSearch class Configuration class Column attr_reader :weight def initialize(column_name, weight, model) @column_name = column_name.to_s @weight = weight @model = model @connection = model.connection end def full_name "#{table_name}.#{column_name}" end def to_sql "coalesce(#{expression}::text, '')" end private def table_name @connection.quote_table_name(@model.table_name) end def column_name @connection.quote_column_name(@column_name) end def expression full_name end def alias Configuration.alias(association.subselect_alias, @column_name) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems