1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

preheat habtm column cache

This commit is contained in:
Aaron Patterson 2013-10-02 17:22:28 -07:00
parent da06ae88ab
commit cb0aa02e74

View file

@ -242,6 +242,7 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase
end
def test_has_many_through_has_and_belongs_to_many_with_has_many_source_reflection_preload
Category.includes(:post_comments).to_a # preheat cache
categories = assert_queries(4) { Category.includes(:post_comments).to_a.sort_by(&:id) }
greetings, more = comments(:greetings), comments(:more_greetings)