diff options
author | Jack <aquajach@gmail.com> | 2016-07-29 19:00:45 +0800 |
---|---|---|
committer | Jack <aquajach@gmail.com> | 2016-07-29 19:00:45 +0800 |
commit | c0eb542e57fe6eaa959218c1a7026e53673ba0cb (patch) | |
tree | 88d2edbe8862b109a5e05744e0bef17f33f1ccef /activerecord/test/cases | |
parent | 3916656f8e9700eb5f1cfc441ff66e1f12173683 (diff) | |
download | rails-c0eb542e57fe6eaa959218c1a7026e53673ba0cb.tar.gz rails-c0eb542e57fe6eaa959218c1a7026e53673ba0cb.tar.bz2 rails-c0eb542e57fe6eaa959218c1a7026e53673ba0cb.zip |
have does_not_support_reverse? support sql functions with commas in nested brackets
Diffstat (limited to 'activerecord/test/cases')
-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 5604124bb3..28345a9b3a 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 |