diff --git a/db/migrate/20170525000002_fixed_twitter_ticket_article_preferences.rb b/db/migrate/20170525000002_fixed_twitter_ticket_article_preferences.rb index ce2cff6d0..40e9e15ee 100644 --- a/db/migrate/20170525000002_fixed_twitter_ticket_article_preferences.rb +++ b/db/migrate/20170525000002_fixed_twitter_ticket_article_preferences.rb @@ -12,6 +12,11 @@ class FixedTwitterTicketArticlePreferences < ActiveRecord::Migration article.preferences.each { |_key, value| next if value.class != ActiveSupport::HashWithIndifferentAccess value.each { |sub_key, sub_level| + if sub_level.class == Twitter::Place + value[sub_key] = sub_level.attrs + changed = true + next + end next if sub_level.class != Twitter::NullObject value[sub_key] = nil changed = true diff --git a/lib/tweet_base.rb b/lib/tweet_base.rb index 52c99d15c..24a41465e 100644 --- a/lib/tweet_base.rb +++ b/lib/tweet_base.rb @@ -379,6 +379,10 @@ class TweetBase preferences.each { |_key, value| next if value.class != ActiveSupport::HashWithIndifferentAccess && value.class != Hash value.each { |sub_key, sub_level| + if sub_level.class == Twitter::Place + value[sub_key] = sub_level.attrs + next + end next if sub_level.class != Twitter::NullObject value[sub_key] = nil }