diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-01-23 11:52:38 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-01-23 11:52:38 +0000 |
commit | 13aeb797cfaa5a70bd8903d8350ea8ce3e0bb151 (patch) | |
tree | 51ae69c0c3837e531b8cef6fac455e06eea04d88 /config/initializers | |
parent | 28061fbcdb2cabbef698db2ca3a80cc428388456 (diff) | |
download | redmine-13aeb797cfaa5a70bd8903d8350ea8ce3e0bb151.tar.gz redmine-13aeb797cfaa5a70bd8903d8350ea8ce3e0bb151.zip |
Use ApplicationRecord instead of ActiveRecord::Base (#38975).
Patch by Minoru Maeda (@maeda-m).
git-svn-id: https://svn.redmine.org/redmine/trunk@22619 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/10-patches.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb index e9d15cae5..c298b9609 100644 --- a/config/initializers/10-patches.rb +++ b/config/initializers/10-patches.rb @@ -1,22 +1,6 @@ # frozen_string_literal: true module ActiveRecord - class Base - # Translate attribute names for validation errors display - def self.human_attribute_name(attr, options = {}) - prepared_attr = attr.to_s.delete_suffix('_id').sub(/^.+\./, '') - class_prefix = name.underscore.tr('/', '_') - - redmine_default = [ - :"field_#{class_prefix}_#{prepared_attr}", - :"field_#{prepared_attr}" - ] - - options[:default] = redmine_default + Array(options[:default]) - - super - end - end # Undefines private Kernel#open method to allow using `open` scopes in models. # See Defect #11545 (http://www.redmine.org/issues/11545) for details. |