Use string.start_with? instead of a regexp

This commit is contained in:
Brenda Wallace
2017-09-01 12:11:57 +12:00
committed by Shiny
parent 63b76d175d
commit c7585f1931

View File

@@ -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