in reply to How To Pass A DateTime Object in $c->flash

The error message is right. When you “put away” a DBIC result(set) it loses its context. You have to give it back, as the message suggests. I’ve never broken down and gone that route so I can’t help with an example but I’m sure there are some in the mail archives, etc.

Storing data in the flash might be better. It’s much faster, and safer. You won’t accidentally expose things. DBIC objects, while “live,” contain all their context, connection, and relationships, and data that might be private compared to what you want to show. Downside is some logic moves to the Controller… I use this often–DBIx::Class::ResultSet::HashRef. It dovetails nicely with Catalyst::View::JSON and such.

  • Comment on Re: How To Pass A DateTime Object in $c->flash

Replies are listed 'Best First'.
Re^2: How To Pass A DateTime Object in $c->flash
by phildeman (Scribe) on May 04, 2016 at 11:07 UTC

    Thanks. I thought I was loosing my mind. I will read up on the DBIxClass::ResultSet:: HashRef documentation.

    -Phil-