Rubocop autocorrections
This commit is contained in:
parent
299738f58d
commit
43bef689fc
85 changed files with 622 additions and 578 deletions
|
|
@ -74,27 +74,27 @@ class RemoveSocialEventsTable < ActiveRecord::Migration
|
|||
TempConference.all.each do |conference|
|
||||
if TempSocialEvent.where(conference_id: conference.id).any?
|
||||
# Find existing question or initialize it
|
||||
question = TempQuestion.find_or_initialize_by(title: 'Which of the following social events are you going to attend?',
|
||||
conference_id: conference.id,
|
||||
question = TempQuestion.find_or_initialize_by(title: 'Which of the following social events are you going to attend?',
|
||||
conference_id: conference.id,
|
||||
question_type_id: qtype.id)
|
||||
question.save!
|
||||
# Enable the question for the conference
|
||||
TempConferencesQuestions.find_or_create_by!(conference_id: conference.id,
|
||||
question_id: question.id)
|
||||
question_id: question.id)
|
||||
end
|
||||
|
||||
TempSocialEvent.where(conference_id: conference.id).each do |social_event|
|
||||
answer = TempAnswer.find_or_create_by!(title: social_event.title)
|
||||
# Associate answer with the question
|
||||
qa = TempQanswer.find_or_initialize_by(question_id: question.id,
|
||||
answer_id: answer.id)
|
||||
answer_id: answer.id)
|
||||
qa.save!
|
||||
|
||||
# Associate appropriate answer with registration
|
||||
TempRegistrationsSocialEvent.where(social_event_id: social_event.id).each do |registration_social_event|
|
||||
registration = TempRegistration.find(registration_social_event.registration_id)
|
||||
TempQanswerRegistration.find_or_create_by!(registration_id: registration.id,
|
||||
qanswer_id: qa.id)
|
||||
qanswer_id: qa.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -124,7 +124,7 @@ class RemoveSocialEventsTable < ActiveRecord::Migration
|
|||
TempQanswerRegistration.where(qanswer_id: qa.id).each do |qa_registration|
|
||||
answer = TempAnswer.find(qa.answer_id)
|
||||
registration = TempRegistration.find(qa_registration.registration_id)
|
||||
social_event = TempSocialEvent.find_or_create_by!(title: answer.title,
|
||||
social_event = TempSocialEvent.find_or_create_by!(title: answer.title,
|
||||
conference_id: conference.id)
|
||||
TempRegistrationsSocialEvent.find_or_create_by!(registration_id: registration.id,
|
||||
social_event_id: social_event.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue