aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorKen Collins <ken@metaskills.net>2010-07-07 15:47:57 -0400
committerJosé Valim <jose.valim@gmail.com>2010-07-08 22:34:34 +0200
commit0e9bc23c0e5dba228626ffbc2bef069331b2e471 (patch)
treecdfd07c581bc3219c91670af4a2899b5e638f417 /activerecord/lib/active_record
parent8b2330ebc3dd2f65a605260366d2445ee7a3009b (diff)
downloadrails-0e9bc23c0e5dba228626ffbc2bef069331b2e471.tar.gz
rails-0e9bc23c0e5dba228626ffbc2bef069331b2e471.tar.bz2
rails-0e9bc23c0e5dba228626ffbc2bef069331b2e471.zip
Fix the #using_limitable_reflections? helper to work correctly by not examining the length of an array which contains false/true, hence always passing. [#4869 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index f39951e16c..3bf4c5bdd1 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -339,7 +339,7 @@ module ActiveRecord
end
def using_limitable_reflections?(reflections)
- reflections.collect(&:collection?).length.zero?
+ reflections.none?(&:collection?)
end
end