From 5ee0d0b31f3c76b0af22edb1deda17db12934d1a Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Thu, 5 Dec 2019 15:05:46 +0100 Subject: [PATCH] Follow up - ff6b4256e1eddf2d46d09a2d0560a9659b7a7c49 - Fixes #2826: Call of private method #blank? on Twitter client instance blocks migration. --- .../20191107050249_issue_2460_fix_corrupted_twitter_ids.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/migrate/20191107050249_issue_2460_fix_corrupted_twitter_ids.rb b/db/migrate/20191107050249_issue_2460_fix_corrupted_twitter_ids.rb index 7d1c5709c..7ee6fc536 100644 --- a/db/migrate/20191107050249_issue_2460_fix_corrupted_twitter_ids.rb +++ b/db/migrate/20191107050249_issue_2460_fix_corrupted_twitter_ids.rb @@ -4,6 +4,7 @@ class Issue2460FixCorruptedTwitterIds < ActiveRecord::Migration[5.2] Channel.where(area: 'Twitter::Account').each do |channel| + client = nil begin client = Twitter::REST::Client.new do |config| 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}" end - next if client.blank? + next if client.nil? channel.options['user']['id'] = client.user.id.to_s