From ab82c87172209015bbc70f1bc4cb3d3575e8f553 Mon Sep 17 00:00:00 2001 From: fosterfarrell9 <28628554+fosterfarrell9@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:45:05 +0200 Subject: [PATCH] Implement Rubocop suggestion --- app/helpers/notifications_helper.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index d574109f1..bb9654096 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -104,12 +104,9 @@ def redemption_notification_item_header(redemption) def redemption_notification_details(redemption) if redemption.tutor? - details = I18n.t("notifications.became_tutor", user: redemption.user.info) - tutorial_titles = redemption.claimed_tutorials.map(&:title).join(", ") - details << I18n.t("notifications.tutorial_details", - tutorials: tutorial_titles) + tutor_notification_details(redemption) else - I18n.t("notifications.became_editor", user: redemption.user.info) + editor_notification_details(redemption) end end @@ -148,7 +145,7 @@ def editor_notification_details(redemption) def truncate_result(result) result.first(40).tap do |truncated| - return truncated.length < 40 ? truncated : truncated + "..." + return truncated.length < 40 ? truncated : "#{truncated}..." end end end