Oh look! It is our favorite friend!!!
def test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct
assert_equal 2, Post.includes(authors: :author_address)
.order('author_addresses.id DESC ').limit(2).to_a.size
assert_equal 3, Post.includes(author: :author_address, authors: :author_address).
order('author_addresses_authors.id DESC ').limit(3).to_a.size
end
Could be related to #376 in both deterministic offset/fetch as well as counts removing order since this test uses empty? which triggers that. This test also made me think about using FIRST_VALUE again.