mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-21 18:42:29 +01:00
Ensure consistent ordering by date and ISO code
This commit is contained in:
parent
4ce9e46f92
commit
418d684343
@ -15,7 +15,6 @@ class Day < Sequel::Model
|
|||||||
interval.begin,
|
interval.begin,
|
||||||
))
|
))
|
||||||
.where(Sequel.expr(:date) <= interval.end)
|
.where(Sequel.expr(:date) <= interval.end)
|
||||||
.order(Sequel.asc(:date))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def currencies
|
def currencies
|
||||||
@ -25,6 +24,7 @@ class Day < Sequel::Model
|
|||||||
Sequel.lit("rates.value::text::float").as(:rate),
|
Sequel.lit("rates.value::text::float").as(:rate),
|
||||||
)
|
)
|
||||||
.join(Sequel.function(:jsonb_each, :rates).lateral.as(:rates), true)
|
.join(Sequel.function(:jsonb_each, :rates).lateral.as(:rates), true)
|
||||||
|
.order(Sequel.asc(:date), Sequel.asc(Sequel.lit("rates.key")))
|
||||||
end
|
end
|
||||||
|
|
||||||
def _nearest_date_with_rates(date)
|
def _nearest_date_with_rates(date)
|
||||||
|
Loading…
Reference in New Issue
Block a user