Serialise Twitter::Place to prevent search indexing issues.

This commit is contained in:
Martin Edenhofer 2017-05-30 01:45:04 +02:00
parent 1a6c8ce0f3
commit 1bf7562229
2 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -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
}