diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index e71f1cca72eb766238a8e3d9b90d2adfd1ceb5db..7bf1d81ea2fd381cae42ee4b7b40c9e3fa17233f 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -217,7 +217,7 @@ def build_joins(relation, joins) end def build_select(arel, selects) - if selects.present? + unless selects.empty? @implicit_readonly = false # TODO: fix this ugly hack, we should refactor the callers to get an ARel compatible array. # Before this change we were passing to ARel the last element only, and ARel is capable of handling an array