From c7585f1931178ae13592beca2bcb5fbfeb5181f5 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 1 Sep 2017 12:11:57 +1200 Subject: [PATCH] Use string.start_with? instead of a regexp --- app/controllers/notifications_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 7a2eae9a4..f69130f07 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -31,10 +31,10 @@ class NotificationsController < ApplicationController @sender_notification.read = true @sender_notification.save @recipient = @sender_notification.sender - @subject = if @sender_notification.subject.matches?(/^Re: /) + @subject = if @sender_notification.subject.start_with? 'Re: ' @sender_notification.subject else - "Re: " + @sender_notification.subject + "Re: #{@sender_notification.subject}" end end