Skip to content

Commit

Permalink
Merge pull request #7 from doits/locale_dependent
Browse files Browse the repository at this point in the history
Fix ruby warnings by using `select` instead of `reject`
  • Loading branch information
attilahorvath authored Sep 9, 2016
2 parents 1187f30 + 6b83adf commit 5d10cbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/i18n/globals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def []=(key, val)

def for_locale(locale)
if key?(locale)
globals_cache[locale] ||= merge(fetch(locale)).reject { |_, i| i.is_a?(Hash) }
globals_cache[locale] ||= merge(fetch(locale)).select { |_, i| !i.is_a?(Hash) }
else
globals_cache[:default] ||= reject { |_, i| i.is_a?(Hash) }
globals_cache[:default] ||= select { |_, i| !i.is_a?(Hash) }
end
end

Expand Down

0 comments on commit 5d10cbf

Please sign in to comment.