mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Autocorrect Style/SafeNavigation
This commit is contained in:
parent
68e8203f27
commit
e1e7c18586
2 changed files with 3 additions and 6 deletions
|
|
@ -196,10 +196,7 @@ class Conference < ApplicationRecord
|
|||
# ====Returns
|
||||
# * +Array+ -> e.g. [0, 3, 3, 5] -> first week 0, second week 3 registrations
|
||||
def get_registrations_per_week
|
||||
return [] unless registrations &&
|
||||
registration_period &&
|
||||
registration_period.start_date &&
|
||||
registration_period.end_date
|
||||
return [] unless registrations && registration_period&.start_date && registration_period.end_date
|
||||
|
||||
reg = registrations.group(:week).order(:week).count
|
||||
start_week = get_registration_start_week
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue