aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-04-29 23:30:38 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-04-29 23:30:38 +0900
commit4e6d84f5553421ad1d24d4d137d46c85d4e1881c (patch)
treefa535de7c1bcc25d7459e59a5bada75e3927417e /activesupport
parent66c99d2430be3e8bde76e0f7712aa99ac0814b81 (diff)
downloadrails-4e6d84f5553421ad1d24d4d137d46c85d4e1881c.tar.gz
rails-4e6d84f5553421ad1d24d4d137d46c85d4e1881c.tar.bz2
rails-4e6d84f5553421ad1d24d4d137d46c85d4e1881c.zip
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