aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMiguel Grazziotin <miguelgraz@gmail.com>2015-06-19 17:27:17 -0300
committerMiguel Grazziotin <miguelgraz@gmail.com>2015-06-19 17:27:17 -0300
commitd3b8216fda928cf26c953dfd51a9a8d7f4732608 (patch)
tree00136ab59970dac0b7dd6fb34ba1adccb8ead7bc /activerecord
parent07cdbb12b35e82c17e2103d38e90b26879e792af (diff)
downloadrails-d3b8216fda928cf26c953dfd51a9a8d7f4732608.tar.gz
rails-d3b8216fda928cf26c953dfd51a9a8d7f4732608.tar.bz2
rails-d3b8216fda928cf26c953dfd51a9a8d7f4732608.zip
using order_values method instead of relying on ActiveRecord::Relation @values hash
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index 18324cf3c6..3aa38dcf78 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -455,13 +455,13 @@ module ActiveRecord
if offset_value && (ids.size - offset_value < expected_size)
expected_size = ids.size - offset_value
else
- ids = ids.first(expected_size) unless self.values[:order]
+ ids = ids.first(expected_size) if order_values.empty?
end
result = where(primary_key => ids).to_a
if result.size == expected_size
- return result if self.values[:order]
+ return result if order_values.present?
records_by_id = result.index_by(&:id)
ids.collect { |id| records_by_id[id.to_i] }.compact
else