Files
fizzy/app/models/notification/mention_payload.rb
T
Rosa Gutierrez 1d2ed91e89 Extract payload building into dedicated classes
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>
2026-02-25 19:31:13 +01:00

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