Skip to content

Commit f417421

Browse files
committed
Fixed test NamedScopingTest#test_scopes_honor_current_scopes_from_when_defined by adding a second column to the ORDER BY condition of the :ranked_by_comments scope of the Post model
1 parent fa2443e commit f417421

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require 'cases/sqlserver_helper'
2+
require 'models/post'
3+
require 'models_sqlserver/post'
4+
5+
# This file is really just to ensure we fix the order by on the
6+
# :ranked_by_comments scope of Post

‎test/models_sqlserver/post.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Post < ActiveRecord::Base
2+
scope :ranked_by_comments, -> { order("comments_count DESC, id ASC") }
3+
end

0 commit comments

Comments
 (0)