Enable Lint/ShadowingOuterLocalVariable for Rubocop.

This commit is contained in:
Guo Xiang Tan
2018-09-04 10:16:21 +08:00
parent 2f5c21e28c
commit 8dc1463ab3
16 changed files with 70 additions and 59 deletions

View File

@@ -106,14 +106,14 @@ module Email
.where(id: PostReply.where(reply_id: post_id).select(:post_id))
.order(id: :desc)
referenced_post_message_ids = referenced_posts.map do |post|
if post.incoming_email&.message_id.present?
"<#{post.incoming_email.message_id}>"
referenced_post_message_ids = referenced_posts.map do |referenced_post|
if referenced_post.incoming_email&.message_id.present?
"<#{referenced_post.incoming_email.message_id}>"
else
if post.post_number == 1
if referenced_post.post_number == 1
"<topic/#{topic_id}@#{host}>"
else
"<topic/#{topic_id}/#{post.id}@#{host}>"
"<topic/#{topic_id}/#{referenced_post.id}@#{host}>"
end
end
end