From abf8de85519141496a6773310964ec03f6106f3f Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 5 Oct 2012 11:52:20 -0300 Subject: Use flat_map { } instead of map {}.flatten --- activerecord/lib/active_record/relation/query_methods.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/relation') 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) -- cgit v1.2.3