aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-08-17 00:28:56 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-08-17 00:28:56 -0300
commit8debad2a18ff497d7410ffe2ceb7eec2bc13f454 (patch)
tree30d7c5c99c0dc7262866340cd49ac1e95c1d6b0b /activerecord/test
parent5fe02881b11b3e7ade089df1b46fff249137fdf8 (diff)
parentd929a218c47b7a5ffc3f8989676a99edb992e2aa (diff)
downloadrails-8debad2a18ff497d7410ffe2ceb7eec2bc13f454.tar.gz
rails-8debad2a18ff497d7410ffe2ceb7eec2bc13f454.tar.bz2
rails-8debad2a18ff497d7410ffe2ceb7eec2bc13f454.zip
Merge pull request #25987 from aquajach/master
Fix does_not_support_reverse? to find sql functions with commas in nested brackets
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index a5bb6e1c51..3efaace69d 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -240,6 +240,15 @@ class RelationTest < ActiveRecord::TestCase
assert_raises(ActiveRecord::IrreversibleOrderError) do
Topic.order("concat(author_name, title)").reverse_order
end
+ assert_raises(ActiveRecord::IrreversibleOrderError) do
+ Topic.order("concat(lower(author_name), title)").reverse_order
+ end
+ assert_raises(ActiveRecord::IrreversibleOrderError) do
+ Topic.order("concat(author_name, lower(title))").reverse_order
+ end
+ assert_raises(ActiveRecord::IrreversibleOrderError) do
+ Topic.order("concat(lower(author_name), title, length(title)").reverse_order
+ end
end
def test_reverse_order_with_nulls_first_or_last