aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_methods.rb
diff options
context:
space:
mode:
authorFinn Young <finnyoung88@gmail.com>2019-02-17 00:41:30 +0000
committerFinn Young <finnyoung88@gmail.com>2019-02-17 00:41:30 +0000
commitdb930ec0fddc2e5e95029b5d761e1207a10b1488 (patch)
tree1758bfa213e01880f3b1344d3587b61d991d2bc7 /activerecord/lib/active_record/relation/query_methods.rb
parentac68550ae6d117b1d257f5df38ba76e03b7e2cf4 (diff)
downloadrails-db930ec0fddc2e5e95029b5d761e1207a10b1488.tar.gz
rails-db930ec0fddc2e5e95029b5d761e1207a10b1488.tar.bz2
rails-db930ec0fddc2e5e95029b5d761e1207a10b1488.zip
Raise ActiveRecord::IrreversibleOrderError if nulls first/last is not a single ordering argument.
Diffstat (limited to 'activerecord/lib/active_record/relation/query_methods.rb')
-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 75976aa8fc..ad8c3aba61 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)