aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-20 22:20:33 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-20 22:20:56 +0530
commit459e9b29d4b9922d5ce3f87dd62fd43e752ac3da (patch)
treea8bd30729dd5dd8cb0e2922d3222763714f41902 /activerecord/lib/active_record/relation
parent8d31c9f3a0c69ce7e8f905a4e75177037bbbcad5 (diff)
downloadrails-459e9b29d4b9922d5ce3f87dd62fd43e752ac3da.tar.gz
rails-459e9b29d4b9922d5ce3f87dd62fd43e752ac3da.tar.bz2
rails-459e9b29d4b9922d5ce3f87dd62fd43e752ac3da.zip
Use @limit_value and @offset_value instead of calling arel
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index 2e451e380b..d6d3d66642 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -272,15 +272,15 @@ module ActiveRecord
result = where(primary_key.in(ids)).all
expected_size =
- if arel.taken && ids.size > arel.taken
- arel.taken
+ if @limit_value && ids.size > @limit_value
+ @limit_value
else
ids.size
end
# 11 ids with limit 3, offset 9 should give 2 results.
- if arel.skipped && (ids.size - arel.skipped < expected_size)
- expected_size = ids.size - arel.skipped
+ if @offset_value && (ids.size - @offset_value < expected_size)
+ expected_size = ids.size - @offset_value
end
if result.size == expected_size