Fix rspec tests because of the changes to the cfp
Remove redundant association Note: a conference created with :full_conference already has a cfp
This commit is contained in:
parent
2bff918556
commit
a1124546f1
16 changed files with 78 additions and 74 deletions
|
|
@ -81,12 +81,12 @@ class Cfp < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def before_end_of_conference
|
||||
if program.conference && program.conference.end_date && end_date && (end_date > program.conference.end_date)
|
||||
if program && 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})")
|
||||
end
|
||||
|
||||
if program.conference && program.conference.end_date && start_date && (start_date > program.conference.end_date)
|
||||
if program && 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})")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class Program < ActiveRecord::Base
|
|||
# * +false+ -> If the CFP is not set or today isn't in the CFP period.
|
||||
# * +true+ -> If today is in the CFP period.
|
||||
def cfp_open?
|
||||
cfp = cfps.events
|
||||
cfp = self.cfp
|
||||
|
||||
cfp.present? && (cfp.start_date..cfp.end_date).cover?(Date.current)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ class Registration < ActiveRecord::Base
|
|||
belongs_to :user
|
||||
belongs_to :conference
|
||||
|
||||
has_and_belongs_to_many :events
|
||||
has_and_belongs_to_many :qanswers
|
||||
has_and_belongs_to_many :vchoices
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue