fix 1.9.3 regression, [] does not work on OpenStruct there.

This commit is contained in:
Sam 2013-06-26 20:51:43 +10:00
parent e4f1255cde
commit 039b4758ac
1 changed files with 2 additions and 2 deletions

View File

@ -337,14 +337,14 @@ class PostAction < ActiveRecord::Base
post_actions.each do |pa| post_actions.each do |pa|
post = post_lookup[pa.post_id] post = post_lookup[pa.post_id]
post[:post_actions] ||= [] post.post_actions ||= []
action = pa.attributes action = pa.attributes
if (pa.related_post && pa.related_post.topic) if (pa.related_post && pa.related_post.topic)
action.merge!(topic_id: pa.related_post.topic_id, action.merge!(topic_id: pa.related_post.topic_id,
slug: pa.related_post.topic.slug, slug: pa.related_post.topic.slug,
permalink: pa.related_post.topic.url) permalink: pa.related_post.topic.url)
end end
post[:post_actions] << action post.post_actions << action
users << pa.user_id users << pa.user_id
end end