Files
fizzy/app/views/notifications/_notification.json.jbuilder
T
Fernando Olivares 009e431ad8 Add has_attachments to notification card JSON
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 14:55:34 +03:00

21 lines
765 B
Ruby

json.cache! notification do
json.(notification, :id, :unread_count)
json.read notification.read?
json.read_at notification.read_at&.utc
json.created_at notification.created_at.utc
json.partial! "notifications/notification/#{notification.source_type.underscore}/body", notification: notification
json.creator notification.creator, partial: "users/user", as: :user
json.card do
json.(notification.card, :id, :number, :title, :status)
json.board_name notification.card.board.name
json.has_attachments notification.card.has_attachments?
json.url card_url(notification.card)
json.column notification.card.column, partial: "columns/column", as: :column if notification.card.column
end
json.url notification_url(notification)
end