diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-11 11:28:13 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-11 11:44:04 -0700 |
commit | 2b8f24998ebafe7257d50aa5ae90fa1a8ae5860f (patch) | |
tree | 82df5dfa57dd7ecffc1a2ecc20ab00257ac6bf38 /activerecord/lib/active_record/relation | |
parent | 3c11e92616c3934a2f82d7a570ea969877ec1a13 (diff) | |
download | rails-2b8f24998ebafe7257d50aa5ae90fa1a8ae5860f.tar.gz rails-2b8f24998ebafe7257d50aa5ae90fa1a8ae5860f.tar.bz2 rails-2b8f24998ebafe7257d50aa5ae90fa1a8ae5860f.zip |
unless Array#empty? is faster than if Array#present?
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index e71f1cca72..7bf1d81ea2 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -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 |