Rebuild rubocop TODOs after auto-correcting
This commit is contained in:
parent
31c50255e9
commit
84dbb52d11
580 changed files with 3689 additions and 3133 deletions
|
|
@ -1,7 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# cannot delete program if there are events submitted
|
||||
|
||||
class Cfp < ApplicationRecord
|
||||
TYPES = %w(events booths tracks).freeze
|
||||
TYPES = %w[events booths tracks].freeze
|
||||
|
||||
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }
|
||||
belongs_to :program
|
||||
|
|
@ -27,11 +29,11 @@ class Cfp < ApplicationRecord
|
|||
# * +True+ -> If cfp dates is updated and all other parameters are set
|
||||
# * +False+ -> Either cfp date is not updated or one or more parameter is not set
|
||||
def notify_on_cfp_date_update?
|
||||
!end_date.blank? && !start_date.blank?\
|
||||
end_date.present? && start_date.present?\
|
||||
&& (start_date_changed? || end_date_changed?)\
|
||||
&& program.conference.email_settings.send_on_cfp_dates_updated\
|
||||
&& !program.conference.email_settings.cfp_dates_updated_subject.blank?\
|
||||
&& !program.conference.email_settings.cfp_dates_updated_body.blank?
|
||||
&& program.conference.email_settings.cfp_dates_updated_subject.present?\
|
||||
&& program.conference.email_settings.cfp_dates_updated_body.present?
|
||||
end
|
||||
|
||||
##
|
||||
|
|
@ -106,20 +108,22 @@ class Cfp < ApplicationRecord
|
|||
private
|
||||
|
||||
def before_end_of_conference
|
||||
if program && program.conference && program.conference.end_date && end_date && (end_date > program.conference.end_date)
|
||||
if program&.conference && program.conference.end_date && end_date && (end_date > program.conference.end_date)
|
||||
errors
|
||||
.add(:end_date, "can't be after the conference end date (#{program.conference.end_date})")
|
||||
.add(:end_date, "can't be after the conference end date (#{program.conference.end_date})")
|
||||
end
|
||||
|
||||
if program && program.conference && program.conference.end_date && start_date && (start_date > program.conference.end_date)
|
||||
if program&.conference && program.conference.end_date && start_date && (start_date > program.conference.end_date)
|
||||
errors
|
||||
.add(:start_date, "can't be after the conference end date (#{program.conference.end_date})")
|
||||
.add(:start_date, "can't be after the conference end date (#{program.conference.end_date})")
|
||||
end
|
||||
end
|
||||
|
||||
def start_after_end_date
|
||||
errors
|
||||
.add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date
|
||||
if start_date && end_date && start_date > end_date
|
||||
errors
|
||||
.add(:start_date, "can't be after the end date")
|
||||
end
|
||||
end
|
||||
|
||||
def conference_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue