aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-05-01 17:22:14 -0700
committerGitHub <noreply@github.com>2017-05-01 17:22:14 -0700
commit8d4d6a706d11b2b482256b9f62ea0678b5f001a5 (patch)
treef401251ede5e7c8adfe90b98f3f39f4cd326b89f /activesupport
parent3fc489fff9f203e9937b06aec949042af0d45c29 (diff)
parent4e6d84f5553421ad1d24d4d137d46c85d4e1881c (diff)
downloadrails-8d4d6a706d11b2b482256b9f62ea0678b5f001a5.tar.gz
rails-8d4d6a706d11b2b482256b9f62ea0678b5f001a5.tar.bz2
rails-8d4d6a706d11b2b482256b9f62ea0678b5f001a5.zip
Merge pull request #28930 from kamipo/use_flat_map
Use `flat_map` rather than `map(&:...).flatten`
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/i18n_railtie.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/i18n_railtie.rb b/activesupport/lib/active_support/i18n_railtie.rb
index b749913ee9..f05c707ccd 100644
--- a/activesupport/lib/active_support/i18n_railtie.rb
+++ b/activesupport/lib/active_support/i18n_railtie.rb
@@ -42,7 +42,7 @@ module I18n
case setting
when :railties_load_path
reloadable_paths = value
- app.config.i18n.load_path.unshift(*value.map(&:existent).flatten)
+ app.config.i18n.load_path.unshift(*value.flat_map(&:existent))
when :load_path
I18n.load_path += value
else
@@ -58,7 +58,7 @@ module I18n
directories = watched_dirs_with_extensions(reloadable_paths)
reloader = app.config.file_watcher.new(I18n.load_path.dup, directories) do
I18n.load_path.keep_if { |p| File.exist?(p) }
- I18n.load_path |= reloadable_paths.map(&:existent).flatten
+ I18n.load_path |= reloadable_paths.flat_map(&:existent)
I18n.reload!
end