Skip to content

Commit 906bf9c

Browse files
authored
Change using of class object for custom translation model (#149)
1 parent b22bd9f commit 906bf9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/i18n/backend/active_record/translation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def lookup(keys, *separator)
9393
end
9494

9595
def available_locales
96-
Translation.select('DISTINCT locale').to_a.map { |t| t.locale.to_sym }
96+
select('DISTINCT locale').to_a.map { |t| t.locale.to_sym }
9797
end
9898

9999
def to_h
100-
Translation.all.each.with_object({}) do |t, memo|
100+
all.each.with_object({}) do |t, memo|
101101
locale_hash = (memo[t.locale.to_sym] ||= {})
102102
keys = t.key.split('.')
103103
keys.each.with_index.inject(locale_hash) do |iterator, (key_part, index)|

0 commit comments

Comments
 (0)