Serialise Twitter::Place to prevent search indexing issues.
This commit is contained in:
parent
1a6c8ce0f3
commit
1bf7562229
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue