From 76b05ef8ade42c160885efab1a3a58f8dc113d25 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Wed, 17 Jun 2020 11:29:37 -0400 Subject: [PATCH] DEV: Use short_date helper for email post template (#10063) --- app/mailers/user_notifications.rb | 8 -------- app/views/email/_post.html.erb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index 184c62b1ec..62525eea17 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -174,14 +174,6 @@ class UserNotifications < ActionMailer::Base ) end - def short_date(dt) - if dt.year == Time.now.year - I18n.l(dt, format: :short_no_year) - else - I18n.l(dt, format: :date_only) - end - end - def digest(user, opts = {}) build_summary_for(user) min_date = opts[:since] || user.last_emailed_at || user.last_seen_at || 1.month.ago diff --git a/app/views/email/_post.html.erb b/app/views/email/_post.html.erb index e83b841af1..57507530d6 100644 --- a/app/views/email/_post.html.erb +++ b/app/views/email/_post.html.erb @@ -20,7 +20,7 @@ <%= post.user.title %> <% end %>
- <%= l post.created_at, format: :short_no_year %> + <%= short_date(post.created_at) %>