Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Catalyst redirect schema freeze/thaw example

by Your Mother (Archbishop)
on Jul 16, 2009 at 00:33 UTC ( [id://780519]=note: print w/replies, xml ) Need Help??


in reply to Catalyst redirect schema freeze/thaw example

You can't freeze DBIC objects that way--they lose special meta attributes--and the session isn't really meant for passing around that kind of data. The stash is, though I realize you're redirecting so you have no choice. This tweak should make it work (untested though). I'd question whatever logic/design led you to save a bunch of data in the session and then redirect; it's probably not the best way to accomplish whatever you're trying to do. You'll probably need to install DBIx::Class::ResultClass::HashRefInflator; I'm pretty sure it's not in the core package.

my $rs = $c->model("DB")->resultset("MyTable")->search(); # This is *probably* what you want and can do instead- # my $rs = $c->model("DB::MyTable")->search(); $rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); $c->session->{data} = [ $rs->all ];

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://780519]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-24 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found