mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
Patch by Takashi Kato. git-svn-id: http://svn.redmine.org/redmine/trunk@21285 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
87097f2204
commit
0352ab71cf
@ -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(/^.+\./, '')
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -121,5 +121,3 @@ module Redmine
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ActiveRecord::Base.send :include, Redmine::Acts::Positioned
|
||||
|
||||
@ -20,6 +20,9 @@
|
||||
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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user