aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-02-17 12:39:44 +0900
committerGitHub <noreply@github.com>2019-02-17 12:39:44 +0900
commit5ca19efafea08984ff1c464c64969f82b9db3569 (patch)
tree89d224f2a2ba7b6f5ca998c36d9e0ec2a1e87cf5 /activerecord/lib/active_record/relation
parent311f00116738df175c12cb36bebe79587f88e00b (diff)
parentdb930ec0fddc2e5e95029b5d761e1207a10b1488 (diff)
downloadrails-5ca19efafea08984ff1c464c64969f82b9db3569.tar.gz
rails-5ca19efafea08984ff1c464c64969f82b9db3569.tar.bz2
rails-5ca19efafea08984ff1c464c64969f82b9db3569.zip
Merge pull request #35274 from AlexBrodianoi/fix_does_not_support_reverse
Raise ActiveRecord::IrreversibleOrderError if nulls first/last is not a single ordering argument.
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 78533e8ff2..3566a57ddc 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -1111,7 +1111,7 @@ module ActiveRecord
# Uses SQL function with multiple arguments.
(order.include?(",") && order.split(",").find { |section| section.count("(") != section.count(")") }) ||
# Uses "nulls first" like construction.
- /nulls (first|last)\Z/i.match?(order)
+ /\bnulls\s+(?:first|last)\b/i.match?(order)
end
def build_order(arel)