module PgSearch::Model

def method_missing(symbol, *args)

def method_missing(symbol, *args)
  case symbol
  when :pg_search_rank
    raise PgSearchRankNotSelected unless respond_to?(:pg_search_rank)
    read_attribute(:pg_search_rank).to_f
  when :pg_search_highlight
    raise PgSearchHighlightNotSelected unless respond_to?(:pg_search_highlight)
    read_attribute(:pg_search_highlight)
  else
    super
  end
end

def respond_to_missing?(symbol, *args)

def respond_to_missing?(symbol, *args)
  case symbol
  when :pg_search_rank
    attributes.key?(:pg_search_rank)
  when :pg_search_highlight
    attributes.key?(:pg_search_highlight)
  else
    super
  end
end