From 52a55f407b74815c13675f4176570b8a952d7b75 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 8 Jan 2024 01:04:37 +0000 Subject: 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 --- app/models/query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/query.rb') diff --git a/app/models/query.rb b/app/models/query.rb index b9a7181fa..1826bd509 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -211,7 +211,7 @@ class QueryFilter def initialize(field, options) @field = field.to_s @options = options - @options[:name] ||= l(options[:label] || "field_#{field}".gsub(/_id$/, '')) + @options[:name] ||= l(options[:label] || "field_#{field}".delete_suffix('_id')) # Consider filters with a Proc for values as remote by default @remote = options.key?(:remote) ? options[:remote] : options[:values].is_a?(Proc) end -- cgit v1.2.3