aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
diff options
context:
space:
mode:
authorBen Toews <mastahyeti@gmail.com>2017-10-11 14:15:47 -0600
committerMatthew Draper <matthew@trebex.net>2017-11-09 22:42:15 +1030
commitc711a27d29a3201ff47751a1d788f1e634186dd3 (patch)
tree6a23b09f48ef0bc30bb2159f595eb7a4a2bc8561 /activerecord/test/cases/relations_test.rb
parentab03eb9f576312c75e61caaf9705a8ac5175c769 (diff)
downloadrails-c711a27d29a3201ff47751a1d788f1e634186dd3.tar.gz
rails-c711a27d29a3201ff47751a1d788f1e634186dd3.tar.bz2
rails-c711a27d29a3201ff47751a1d788f1e634186dd3.zip
convert order arg to string before checking if we can reverse it
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r--activerecord/test/cases/relations_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index f3f82e7591..4c865ef965 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -248,9 +248,9 @@ class RelationTest < ActiveRecord::TestCase
end
def test_reverse_order_with_function_other_predicates
- topics = Topic.order("author_name, length(title), id").reverse_order
+ topics = Topic.order(Arel.sql("author_name, length(title), id")).reverse_order
assert_equal topics(:second).title, topics.first.title
- topics = Topic.order("length(author_name), id, length(title)").reverse_order
+ topics = Topic.order(Arel.sql("length(author_name), id, length(title)")).reverse_order
assert_equal topics(:fifth).title, topics.first.title
end