Skip to content

Commit

Permalink
Use each_with_object and more descriptive names
Browse files Browse the repository at this point in the history
  • Loading branch information
gburgett committed Mar 7, 2019
1 parent daa63b4 commit d298938
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/i18n/backend/chain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ def init_translations
end

def translations
backends.reverse.inject({}) do |h, b|
to_merge = b.instance_eval do
backends.reverse.each_with_object({}) do |backend, memo|
partial_translations = backend.instance_eval do
init_translations unless initialized?
translations
end

h.deep_merge(to_merge)
memo.deep_merge!(partial_translations)
end
end

Expand Down

0 comments on commit d298938

Please sign in to comment.