summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-08-12 23:40:44 +0000
committerGo MAEDA <maeda@farend.jp>2018-08-12 23:40:44 +0000
commitb7f15fbadcaed2b708aa156048ab5c37cb7b01ff (patch)
treec87103a67f1cf7ec2c2ceb3aa441c5525493b8f8 /config
parent02191a08fdd2b4267167230525dfbe676d751ce9 (diff)
downloadredmine-b7f15fbadcaed2b708aa156048ab5c37cb7b01ff.tar.gz
redmine-b7f15fbadcaed2b708aa156048ab5c37cb7b01ff.zip
Replace String#gsub with faster String#tr (#29363).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17469 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config')
-rw-r--r--config/initializers/10-patches.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index d4e1ae889..b5698b436 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -6,7 +6,7 @@ module ActiveRecord
# Translate attribute names for validation errors display
def self.human_attribute_name(attr, options = {})
prepared_attr = attr.to_s.sub(/_id$/, '').sub(/^.+\./, '')
- class_prefix = name.underscore.gsub('/', '_')
+ class_prefix = name.underscore.tr('/', '_')
redmine_default = [
:"field_#{class_prefix}_#{prepared_attr}",