mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 05:20:28 +01:00
Use match? instead of =~ when MatchData is not used (#34150).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20168 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -179,7 +179,7 @@ class IssueImport < Import
|
||||
else
|
||||
add_callback(parent_issue_id, 'set_as_parent', item.position)
|
||||
end
|
||||
elsif parent_issue_id =~ /\A\d+\z/
|
||||
elsif /\A\d+\z/.match?(parent_issue_id)
|
||||
# refers to other row by position
|
||||
parent_issue_id = parent_issue_id.to_i
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ class Setting < ActiveRecord::Base
|
||||
if settings.key?(:mail_from)
|
||||
begin
|
||||
mail_from = Mail::Address.new(settings[:mail_from])
|
||||
raise unless mail_from.address =~ EmailAddress::EMAIL_REGEXP
|
||||
raise unless EmailAddress::EMAIL_REGEXP.match?(mail_from.address)
|
||||
rescue
|
||||
messages << [:mail_from, l('activerecord.errors.messages.invalid')]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user