Autocorrect Style/SafeNavigation

This commit is contained in:
Henne Vogelsang 2024-12-02 11:46:33 +01:00
parent 68e8203f27
commit e1e7c18586
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
2 changed files with 3 additions and 6 deletions

View file

@ -82,13 +82,13 @@ class EventSchedule < ApplicationRecord
end
def start_after_end_hour
return unless event && start_time && event.program && event.program.conference && event.program.conference.end_hour
return unless event && start_time && event.program&.conference && event.program.conference.end_hour
errors.add(:start_time, "can't be after the conference end hour (#{event.program.conference.end_hour})") if start_time.hour >= event.program.conference.end_hour
end
def start_before_start_hour
return unless event && start_time && event.program && event.program.conference && event.program.conference.start_hour
return unless event && start_time && event.program&.conference && event.program.conference.start_hour
errors.add(:start_time, "can't be before the conference start hour (#{event.program.conference.start_hour})") if start_time.hour < event.program.conference.start_hour
end