Feature #32938 » alt-0003-Add-core-extensions-in-prepare-method.patch
| config/initializers/10-patches.rb | ||
|---|---|---|
|
# 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(/^.+\./, '')
|
||
| config/initializers/30-redmine.rb | ||
|---|---|---|
|
# 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
|
||
| lib/redmine/acts/positioned.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
end
|
||
|
ActiveRecord::Base.send :include, Redmine::Acts::Positioned
|
||
| lib/redmine/preparation.rb | ||
|---|---|---|
|
module Redmine
|
||
|
module Preparation
|
||
|
def self.prepare
|
||
|
ActiveRecord::Base.include Redmine::Acts::Positioned
|
||
|
ActiveRecord::Base.include Redmine::I18n
|
||
|
Scm::Base.add "Subversion"
|
||
|
Scm::Base.add "Mercurial"
|
||
|
Scm::Base.add "Cvs"
|
||