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,25 +1,26 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MoveConferenceContactDetailsToContact < ActiveRecord::Migration
|
||||
class TempConference < ActiveRecord::Base
|
||||
class TempConference < ApplicationRecord
|
||||
self.table_name = 'conferences'
|
||||
end
|
||||
|
||||
class TempContact < ActiveRecord::Base
|
||||
class TempContact < ApplicationRecord
|
||||
self.table_name = 'contacts'
|
||||
end
|
||||
|
||||
def change
|
||||
# Move all the settings to the new object
|
||||
TempConference.all.each do |conference|
|
||||
unless TempContact.exists?(conference_id: conference.id)
|
||||
TempContact.create(social_tag: conference.social_tag,
|
||||
email: conference.contact_email,
|
||||
facebook: conference.facebook_url,
|
||||
googleplus: conference.google_url,
|
||||
twitter: conference.twitter_url,
|
||||
instagram: conference.instagram_url,
|
||||
public: conference.include_social_media_in_splash,
|
||||
conference_id: conference.id)
|
||||
end
|
||||
next if TempContact.exists?(conference_id: conference.id)
|
||||
TempContact.create(social_tag: conference.social_tag,
|
||||
email: conference.contact_email,
|
||||
facebook: conference.facebook_url,
|
||||
googleplus: conference.google_url,
|
||||
twitter: conference.twitter_url,
|
||||
instagram: conference.instagram_url,
|
||||
public: conference.include_social_media_in_splash,
|
||||
conference_id: conference.id)
|
||||
end
|
||||
# Then remove all the columns
|
||||
remove_column :conferences, :social_tag
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue