mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add a deprecation for nested i18n namespace lookup.
This commit is contained in:
parent
83efad01e9
commit
c19bd4f88e
1 changed files with 16 additions and 0 deletions
|
@ -96,5 +96,21 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
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"
|
||||
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"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue