diff --git a/lib/i18n/backend/active_record.rb b/lib/i18n/backend/active_record.rb index 4d2bcbd..e9024ec 100644 --- a/lib/i18n/backend/active_record.rb +++ b/lib/i18n/backend/active_record.rb @@ -64,7 +64,7 @@ def initialized? end def init_translations - @translations = Translation.to_hash + @translations = Translation.to_h end def translations(do_init: false) diff --git a/lib/i18n/backend/active_record/translation.rb b/lib/i18n/backend/active_record/translation.rb index f516f86..ee03a64 100644 --- a/lib/i18n/backend/active_record/translation.rb +++ b/lib/i18n/backend/active_record/translation.rb @@ -79,7 +79,7 @@ def available_locales Translation.select('DISTINCT locale').to_a.map { |t| t.locale.to_sym } end - def to_hash + def to_h Translation.all.each.with_object({}) do |t, memo| locale_hash = (memo[t.locale.to_sym] ||= {}) keys = t.key.split('.')