mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #1675 from thoefer/3-1-stable
Fix for startup problems due to deprecation warning on nested models
This commit is contained in:
@@ -99,18 +99,25 @@ module ActiveRecord
|
||||
|
||||
config.after_initialize do
|
||||
container = :"activerecord.attributes"
|
||||
I18n.t(container, :default => {}).each do |key, value|
|
||||
if value.is_a?(Hash) && value.any? { |k,v| v.is_a?(Hash) }
|
||||
$stderr.puts "[DEPRECATION WARNING] Nested I18n namespace lookup under \"#{container}.#{key}\" is no longer supported"
|
||||
lookup = I18n.t(container, :default => {})
|
||||
if lookup.is_a?(Hash)
|
||||
lookup.each do |key, value|
|
||||
if value.is_a?(Hash) && value.any? { |k,v| v.is_a?(Hash) }
|
||||
$stderr.puts "[DEPRECATION WARNING] Nested I18n namespace lookup under \"#{container}.#{key}\" is no longer supported"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
container = :"activerecord.models"
|
||||
I18n.t(container, :default => {}).each do |key, value|
|
||||
if value.is_a?(Hash)
|
||||
$stderr.puts "[DEPRECATION WARNING] Nested I18n namespace lookup under \"#{container}.#{key}\" is no longer supported"
|
||||
lookup = I18n.t(container, :default => {})
|
||||
if lookup.is_a?(Hash)
|
||||
lookup.each do |key, value|
|
||||
if value.is_a?(Hash)
|
||||
$stderr.puts "[DEPRECATION WARNING] Nested I18n namespace lookup under \"#{container}.#{key}\" is no longer supported"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user