Skip to content

Commit b37bcea

Browse files
committed
added Notification#rendered_timestamp QoL method
1 parent d59551e commit b37bcea

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/models/notification.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ def read?
1616
def unread?
1717
!read?
1818
end
19+
20+
def rendered_timestamp
21+
formatted = created_at.strftime('%b %-d, %Y at %H:%M')
22+
CGI.unescape_html(formatted).html_safe
23+
end
1924
end

0 commit comments

Comments
 (0)