Follow up - ff6b4256e1 - Fixes #2826: Call of private method #blank? on Twitter client instance blocks migration.

This commit is contained in:
Thorsten Eckel 2019-12-05 15:05:46 +01:00
parent 2317537f0e
commit 5ee0d0b31f

View file

@ -4,6 +4,7 @@ class Issue2460FixCorruptedTwitterIds < ActiveRecord::Migration[5.2]
Channel.where(area: 'Twitter::Account').each do |channel| Channel.where(area: 'Twitter::Account').each do |channel|
client = nil
begin begin
client = Twitter::REST::Client.new do |config| client = Twitter::REST::Client.new do |config|
config.consumer_key = channel.options['auth']['consumer_key'] config.consumer_key = channel.options['auth']['consumer_key']
@ -15,7 +16,7 @@ class Issue2460FixCorruptedTwitterIds < ActiveRecord::Migration[5.2]
Rails.logger.error "Error while trying to update corrupted Twitter User ID: #{e.message}" Rails.logger.error "Error while trying to update corrupted Twitter User ID: #{e.message}"
end end
next if client.blank? next if client.nil?
channel.options['user']['id'] = client.user.id.to_s channel.options['user']['id'] = client.user.id.to_s