mirror of
https://github.com/discourse/discourse.git
synced 2026-08-12 05:55:39 -05:00
FIX: Array#first with block will return the first element if nothing matches.
This commit is contained in:
@@ -261,8 +261,8 @@ class PostAlerter
|
||||
|
||||
topic_title = post.topic.title
|
||||
# when sending a private message email, keep the original title
|
||||
if post.topic.private_message? && modifications = post.revisions.map(&:modifications).to_a
|
||||
if first_title_modification = modifications.first { |m| m.has_key?("title") }
|
||||
if post.topic.private_message? && modifications = post.revisions.map(&:modifications)
|
||||
if first_title_modification = modifications.find { |m| m.has_key?("title") }
|
||||
topic_title = first_title_modification["title"][0]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user