From 418d6843432b869143aadf1b00432635f7755de3 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Wed, 20 Nov 2024 14:58:17 +0100 Subject: [PATCH] Ensure consistent ordering by date and ISO code --- lib/day.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/day.rb b/lib/day.rb index 6588034..d79521e 100644 --- a/lib/day.rb +++ b/lib/day.rb @@ -15,7 +15,6 @@ class Day < Sequel::Model interval.begin, )) .where(Sequel.expr(:date) <= interval.end) - .order(Sequel.asc(:date)) end def currencies @@ -25,6 +24,7 @@ class Day < Sequel::Model Sequel.lit("rates.value::text::float").as(:rate), ) .join(Sequel.function(:jsonb_each, :rates).lateral.as(:rates), true) + .order(Sequel.asc(:date), Sequel.asc(Sequel.lit("rates.key"))) end def _nearest_date_with_rates(date)