Browse files

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

  • Loading branch information...
tenderlove committed Aug 11, 2010
1 parent 8464ee0 commit dac2b37b037587053b53cb6ed3c67a1fd4339778
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/query_methods.rb
@@ -217,7 +217,7 @@ def build_joins(relation, joins)
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

0 comments on commit dac2b37

Please sign in to comment.