diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-17 00:28:56 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-17 00:28:56 -0300 |
commit | 8debad2a18ff497d7410ffe2ceb7eec2bc13f454 (patch) | |
tree | 30d7c5c99c0dc7262866340cd49ac1e95c1d6b0b /activerecord/test | |
parent | 5fe02881b11b3e7ade089df1b46fff249137fdf8 (diff) | |
parent | d929a218c47b7a5ffc3f8989676a99edb992e2aa (diff) | |
download | rails-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.rb | 9 |
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 |