Skip to content

Commit

Permalink
Fix lifers ordering in year summary.
Browse files Browse the repository at this point in the history
  • Loading branch information
khustochka committed Sep 10, 2024
1 parent c592f69 commit da8d076
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/lifer_observation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class << self
def life_observ_relation
select("DISTINCT ON (species_id) *")
.joins(:card, :taxon)
.order(:species_id, Arel.sql("observ_date ASC, to_timestamp(start_time, 'HH24:MI') ASC NULLS LAST"))
.where("(observ_date, species_id) IN (#{life_dates_sql})")
end

Expand Down

0 comments on commit da8d076

Please sign in to comment.