summaryrefslogtreecommitdiffstats
path: root/config/initializers
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2021-11-17 20:47:53 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2021-11-17 20:47:53 +0000
commit0352ab71cf89950f81e29f034529ce16b5bd9105 (patch)
treeda8872339cd94c21713c8978dbc3db201d8b3413 /config/initializers
parent87097f2204f7bef10146da87162e2c1551d124d8 (diff)
downloadredmine-0352ab71cf89950f81e29f034529ce16b5bd9105.tar.gz
redmine-0352ab71cf89950f81e29f034529ce16b5bd9105.zip
Add core extensions in prepare method (#29914, #32938).
Patch by Takashi Kato. git-svn-id: http://svn.redmine.org/redmine/trunk@21285 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/10-patches.rb4
-rw-r--r--config/initializers/30-redmine.rb9
2 files changed, 4 insertions, 9 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index 850ab460a..28f4f3670 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -1,11 +1,7 @@
# frozen_string_literal: true
-require 'active_record'
-require 'redmine/i18n'
-
module ActiveRecord
class Base
- include Redmine::I18n
# Translate attribute names for validation errors display
def self.human_attribute_name(attr, options = {})
prepared_attr = attr.to_s.sub(/_id$/, '').sub(/^.+\./, '')
diff --git a/config/initializers/30-redmine.rb b/config/initializers/30-redmine.rb
index 568bcb741..380c783f4 100644
--- a/config/initializers/30-redmine.rb
+++ b/config/initializers/30-redmine.rb
@@ -1,14 +1,13 @@
# frozen_string_literal: true
-require 'redmine/i18n'
require 'redmine/configuration'
require 'redmine/plugin_loader'
-I18n.backend = Redmine::I18n::Backend.new
-# Forces I18n to load available locales from the backend
-I18n.config.available_locales = nil
-
Rails.application.config.to_prepare do
+ I18n.backend = Redmine::I18n::Backend.new
+ # Forces I18n to load available locales from the backend
+ I18n.config.available_locales = nil
+
Redmine::Preparation.prepare
end