unless Array#empty? is faster than if Array#present?

This commit is contained in:
Aaron Patterson
2010-08-11 11:28:13 -07:00
parent 3c11e92616
commit 2b8f24998e

View File

@@ -217,7 +217,7 @@ module ActiveRecord
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