From 13aeb797cfaa5a70bd8903d8350ea8ce3e0bb151 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Tue, 23 Jan 2024 11:52:38 +0000 Subject: 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 --- config/initializers/10-patches.rb | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'config/initializers') 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. -- cgit v1.2.3