From: Toshi MARUYAMA Date: Sat, 7 Nov 2020 12:31:10 +0000 (+0000) Subject: use "do end" instead of {} at app/models/principal.rb X-Git-Tag: 4.2.0~529 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=06b53fd60f48d06c9e95a0418367e42cff2039d9;p=redmine.git use "do end" instead of {} at app/models/principal.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20288 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/principal.rb b/app/models/principal.rb index 525693129..c31effec4 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -183,11 +183,11 @@ class Principal < ActiveRecord::Base if principal.nil? && / /.match?(keyword) firstname, lastname = *(keyword.split) # "First Last Throwaway" principal ||= - principals.detect {|a| + principals.detect do |a| a.is_a?(User) && firstname.casecmp(a.firstname.to_s) == 0 && lastname.casecmp(a.lastname.to_s) == 0 - } + end end if principal.nil? principal ||= principals.detect {|a| keyword.casecmp(a.name) == 0}