Skip to content

Commit

Permalink
Implement Rubocop suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
fosterfarrell9 committed Aug 16, 2024
1 parent b1a6614 commit ab82c87
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/helpers/notifications_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit ab82c87

Please sign in to comment.