[Catalyst] Audit logs: model or controller?
Charlie Garrison
garrison at zeta.org.au
Tue Sep 18 03:10:00 GMT 2007
Good morning,
On 17/9/07 at 8:37 AM -0500, Jonathan Rockway <jon at jrock.us> wrote:
>> Best practices say to only store the info from $context that you need
>> in your model rather than a reference to $context itself. IOW, if you
>> just need the current user object, then just store that. I don't
>> recall the reasoning for it though.
>
>You can try mixing in Catalyst::Component::ACCEPT_CONTEXT. It will
>handle the ACCEPT_CONTEXT magic and provide $c as $self->context for
>you. The reason for not storing $context in your model is because it
>will create a circular reference if you're not careful.
>Catalyst::Component::ACCEPT_CONTEXT is careful, so you don't
>need to
>worry about that. :)
Thanks for that reference. That was one of the sources I looked
at, but I needed slightly different behaviour. I missed the
'weaken' stuff though. Reading up on that now.
Charlie
--
Charlie Garrison <garrison at zeta.org.au>
PO Box 141, Windsor, NSW 2756, Australia
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt
More information about the Catalyst
mailing list