Rebuild rubocop TODOs after auto-correcting

This commit is contained in:
James Mason 2018-04-04 10:18:51 -07:00
parent 31c50255e9
commit 84dbb52d11
No known key found for this signature in database
GPG key ID: 1B3951886C449023
580 changed files with 3689 additions and 3133 deletions

View file

@ -1,17 +1,19 @@
# frozen_string_literal: true
class CreateProgramsTable < ActiveRecord::Migration
class TempConference < ActiveRecord::Base
class TempConference < ApplicationRecord
self.table_name = 'conferences'
end
class TempCfp < ActiveRecord::Base
class TempCfp < ApplicationRecord
self.table_name = 'cfps'
end
class TempCallForPaper < ActiveRecord::Base
class TempCallForPaper < ApplicationRecord
self.table_name = 'call_for_papers'
end
class TempProgram < ActiveRecord::Base
class TempProgram < ApplicationRecord
self.table_name = 'programs'
end
@ -27,21 +29,19 @@ class CreateProgramsTable < ActiveRecord::Migration
add_column :call_for_papers, :program_id, :integer
TempConference.all.each do |conference|
unless TempProgram.find_by(conference_id: conference.id)
program = TempProgram.new
program.conference_id = conference.id
program.save!
next if TempProgram.find_by(conference_id: conference.id)
program = TempProgram.new
program.conference_id = conference.id
program.save!
if (cfp = TempCallForPaper.find_by(conference_id: conference.id))
cfp.program_id = program.id
cfp.save!
next unless (cfp = TempCallForPaper.find_by(conference_id: conference.id))
cfp.program_id = program.id
cfp.save!
program.rating = cfp.rating
program.schedule_public = cfp.schedule_public
program.schedule_fluid = cfp.schedule_changes
program.save!
end
end
program.rating = cfp.rating
program.schedule_public = cfp.schedule_public
program.schedule_fluid = cfp.schedule_changes
program.save!
end
remove_column :call_for_papers, :conference_id
remove_column :call_for_papers, :rating
@ -58,16 +58,14 @@ class CreateProgramsTable < ActiveRecord::Migration
add_column :call_for_papers, :schedule_changes, :boolean, default: false
TempConference.all.each do |conference|
if (program = TempProgram.find_by(conference_id: conference.id))
if (cfp = TempCallForPaper.find_by(program_id: program.id))
cfp.conference_id = program.conference_id
cfp.rating = program.rating
cfp.schedule_public = program.schedule_public
cfp.schedule_changes = program.schedule_fluid
next unless (program = TempProgram.find_by(conference_id: conference.id))
next unless (cfp = TempCallForPaper.find_by(program_id: program.id))
cfp.conference_id = program.conference_id
cfp.rating = program.rating
cfp.schedule_public = program.schedule_public
cfp.schedule_changes = program.schedule_fluid
cfp.save!
end
end
cfp.save!
end
remove_column :call_for_papers, :program_id