Replace String#sub with delete_prefix / delete_suffix (#40008).

Patch by Go MAEDA (@maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@22596 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-01-08 01:04:37 +00:00
parent 4d3fc7f89e
commit 52a55f407b
14 changed files with 20 additions and 18 deletions

View File

@@ -596,7 +596,7 @@ class CustomFieldsControllerTest < Redmine::ControllerTest
def custom_field_classes
files =
Dir.glob(File.join(Rails.root, 'app/models/*_custom_field.rb')).
map {|f| File.basename(f).sub(/\.rb$/, '')}
map {|f| File.basename(f).delete_suffix('.rb')}
classes = files.map {|x| x.classify.constantize}
assert classes.size > 0
classes