diff options
author | Miguel Grazziotin <miguelgraz@gmail.com> | 2015-06-19 17:27:17 -0300 |
---|---|---|
committer | Miguel Grazziotin <miguelgraz@gmail.com> | 2015-06-19 17:27:17 -0300 |
commit | d3b8216fda928cf26c953dfd51a9a8d7f4732608 (patch) | |
tree | 00136ab59970dac0b7dd6fb34ba1adccb8ead7bc /activerecord/lib/active_record | |
parent | 07cdbb12b35e82c17e2103d38e90b26879e792af (diff) | |
download | rails-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/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 4 |
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 |