Fix datatypes in query

This commit is contained in:
Roberto Alsina 2024-05-15 20:06:35 -03:00
parent 6ed644d1d0
commit 9283ee0a03

View File

@ -156,7 +156,7 @@ class Handler
if prefijo.nil? && year.nil? if prefijo.nil? && year.nil?
# Global totals # Global totals
sql = %( sql = %(
SELECT total, nombre SELECT total::integer, nombre
FROM totales FROM totales
ORDER BY total DESC ORDER BY total DESC
LIMIT 50 LIMIT 50
@ -164,7 +164,7 @@ class Handler
elsif prefijo.nil? && !year.nil? elsif prefijo.nil? && !year.nil?
# Per-year totals # Per-year totals
sql = %( sql = %(
SELECT contador, nombre SELECT contador::integer, nombre
FROM nombres FROM nombres
WHERE WHERE
anio = '#{year}' anio = '#{year}'