rails/rails — pull request #14992 by fredwu (2014-05-06 12:42:27+00:00)
Title: Habtm relation size calculation fix

HABTM should fall back to using the normal CollectionAssociation's size calculation if the collection is not cached or loaded.

This addresses both #14913 and #14914 for master.

If I didn't break anything and if everyone's happy with the change, I will backport this to 3.2, 4.0 and 4.1.

cc @tenderlove @rafaelfranca @carlosantoniodasilva @senny

P.S. This fix was done independently to #14969.