Skip to content

Commit

Permalink
Ensure correct ordering of results in test_update_all_with_joins_and_…
Browse files Browse the repository at this point in the history
…offset_and_order

Last two asserts in this test assume that all_comments are ordered by posts.id and then by comments.id therefore additional ordering is added. Without it test was failing on Oracle which returned results in different order.
  • Loading branch information
rsim authored and jonleighton committed Aug 30, 2011
1 parent 2350fec commit 60d8e4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/test/cases/relations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ def test_update_all_with_joins_and_offset
end

def test_update_all_with_joins_and_offset_and_order
all_comments = Comment.joins(:post).where('posts.id' => posts(:welcome).id).order('posts.id')
all_comments = Comment.joins(:post).where('posts.id' => posts(:welcome).id).order('posts.id', 'comments.id')
count = all_comments.count
comments = all_comments.offset(1)

Expand Down

0 comments on commit 60d8e4a

Please sign in to comment.