Maybe this is expected behavior (if so, I'd love to know why) and it
may give Aristotle a chance to remind us how awful TT2 is (but I
keed!), still maybe it's something worth noting.
This works:
[% IF Catalyst.user_exists %]
[% vote = Catalyst.user.votes({word => w.id}) %]
[% END %]
[% IF vote %]
You rated this “[% vote.rating %]”
[% END %]
and yields, eg: You rated this "good"
This does not:
[% vote = Catalyst.user.votes({word => w.id}) IF Catalyst.user_exists %]
[% IF vote %]
You rated this “[% vote.rating %]”
[% END %]
and yields for all cases (and columns): You rated this ""
The first properly retrieves and displays the rating. The second
retrieves an empty object (or maybe just a "Class::stringy::thing"?
Dumper does nothing with it) of the proper class without any column
values attached. The only difference in all the versions I tried was
the TT2 logic block versus inline IF.
–Ashley
--
_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/