aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
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 /activerecord/lib/active_record
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 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/reflection.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 24ca8b0be4..5ce134d6b7 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -212,7 +212,7 @@ module ActiveRecord
end
def constraints
- chain.map(&:scopes).flatten
+ chain.flat_map(&:scopes)
end
def counter_cache_column