Stop adding empty caches to resultsets chained off prefetched objects
authorMatt Phillips <mattp@cpan.org>
Thu, 25 Apr 2013 17:56:36 +0000 (13:56 -0400)
committerPeter Rabbitson <ribasushi@cpan.org>
Fri, 26 Apr 2013 09:55:14 +0000 (11:55 +0200)
commitbdb4d9404c947de09d19c6af830518b5c9801094
treea8909194b3c7997077a5d94f4065d7b010a82fc2
parentcdbb48a2b313f31cebfc9f4aa700fc9be8f05901
Stop adding empty caches to resultsets chained off prefetched objects

Prior to ce55688, the related_rs cache loading mechanism only conditionally
loaded if the base rs cache was defined. After this was removed an empty
arrayref (meaning "no related results") could potentially be set as the cache.
This commit ensures the cache is only set when there are actual cache results.
lib/DBIx/Class/ResultSet.pm
t/prefetch/via_search_related.t