Sort events by time

This commit is contained in:
Michael Ball 2020-07-17 23:06:43 -07:00
parent 611277ef67
commit 4babd84439
2 changed files with 5 additions and 1 deletions

View file

@ -288,6 +288,10 @@ class Event < ApplicationRecord
program.conference
end
def <=>(other)
time <=> other.time
end
private
##

View file

@ -20,7 +20,7 @@ class Program < ApplicationRecord
end
def with_registration_open
select { |e| e if e.registration_possible? }
select { |e| e if e.registration_possible? }.sort
end
# All confirmed events of the conference with attribute require_registration