1d2ed91e89
Separates notification payload construction from push delivery by introducing DefaultPayload, EventPayload, and MentionPayload classes that encapsulate the title, body, and URL generation for each notification type. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
21 lines
366 B
Ruby
21 lines
366 B
Ruby
class Notification::MentionPayload < Notification::DefaultPayload
|
|
include ExcerptHelper
|
|
|
|
private
|
|
def title
|
|
"#{mention.mentioner.first_name} mentioned you"
|
|
end
|
|
|
|
def body
|
|
format_excerpt(mention.source.mentionable_content, length: 200)
|
|
end
|
|
|
|
def url
|
|
card_url(card)
|
|
end
|
|
|
|
def mention
|
|
notification.source
|
|
end
|
|
end
|