[Templates] Problem with HASH.size vs ARRAY.size
apv
apv@sedition.com
Fri, 17 Nov 2006 19:58:25 -0800
So, I've messed around with .list and []s everywhere and I can't make
this work.
Doing this (DBIx::Class underneath):
[% comments = article.comments(status => 'approved') %]
<h2>comment count: [% comments.size %]</h2>
If there are more than one; it works fine. "comments" is an array ref
of comment objects.
If there is only one comment, it returns a single comment object
(HASH) and instead of getting "1" for the comment count, we get the
key/val pair count. Is there something simple I'm missing? If
possible, I don't want to resort to installing "ref" methods in the
OPS tables; or whatever else.
-Ashley