We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
order
1 parent cb10d5b commit a6b9e32Copy full SHA for a6b9e32
elasticsearch-model/test/integration/active_record_basic_test.rb
@@ -126,7 +126,11 @@ class ::Article < ActiveRecord::Base
126
should "allow ordering response.records in SQL" do
127
response = Article.search query: { match: { title: { query: 'test' } } }
128
129
- assert_equal 'Testing Coding', response.records.order(title: :desc).first.title
+ if ::ActiveRecord.respond_to?(:version) && ::ActiveRecord.version.to_s > '4'
130
+ assert_equal 'Testing Coding', response.records.order(title: :desc).first.title
131
+ else
132
+ assert_equal 'Testing Coding', response.records.order('title DESC').first.title
133
+ end
134
end
135
136
0 commit comments