diff options
author | akihiro17 <coolwizard11@gmail.com> | 2015-10-22 16:11:27 +0900 |
---|---|---|
committer | akihiro17 <coolwizard11@gmail.com> | 2015-10-30 00:13:11 +0900 |
commit | 0fdc2dbe6f14221ccc3244eb749a72c9097e164c (patch) | |
tree | 1f216d594955bba4a0160b74cf21d785b4e011a0 /activerecord/lib/active_record/associations/preloader | |
parent | 59ec8a592d7125f12e33a8aba22b4d2fc4ae301f (diff) | |
download | rails-0fdc2dbe6f14221ccc3244eb749a72c9097e164c.tar.gz rails-0fdc2dbe6f14221ccc3244eb749a72c9097e164c.tar.bz2 rails-0fdc2dbe6f14221ccc3244eb749a72c9097e164c.zip |
Set `scope.reordering_value` to `true` if :reordering values are specified
We should call `scope.order!` and set `scope.reordering_value` to `true` if :reordering values are specified
Fixes #21886
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader')
-rw-r--r-- | activerecord/lib/active_record/associations/preloader/association.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/preloader/association.rb b/activerecord/lib/active_record/associations/preloader/association.rb index 29dd0643d6..c43f13f3c4 100644 --- a/activerecord/lib/active_record/associations/preloader/association.rb +++ b/activerecord/lib/active_record/associations/preloader/association.rb @@ -136,6 +136,10 @@ module ActiveRecord end scope.order! preload_values[:order] || values[:order] + if preload_values[:reordering] || values[:reordering] + scope.reordering_value = true + end + if preload_values[:readonly] || values[:readonly] scope.readonly! end |