aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-10-05 11:52:20 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-10-05 11:52:20 -0300
commitabf8de85519141496a6773310964ec03f6106f3f (patch)
tree5149d0c61125567f0e704d2f520611a1718e168a /activerecord/lib/active_record/relation
parent5c078368c762ec025997af6b2c94632b2f9301d2 (diff)
downloadrails-abf8de85519141496a6773310964ec03f6106f3f.tar.gz
rails-abf8de85519141496a6773310964ec03f6106f3f.tar.bz2
rails-abf8de85519141496a6773310964ec03f6106f3f.zip
Use flat_map { } instead of map {}.flatten
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 3c59bd8a68..21c2b02b7e 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -782,7 +782,7 @@ module ActiveRecord
def reverse_sql_order(order_query)
order_query = ["#{quoted_table_name}.#{quoted_primary_key} ASC"] if order_query.empty?
- order_query.map do |o|
+ order_query.flat_map do |o|
case o
when Arel::Nodes::Ordering
o.reverse
@@ -794,7 +794,7 @@ module ActiveRecord
else
o
end
- end.flatten
+ end
end
def array_of_strings?(o)