[Catalyst] updating $c->user at runtime

Jess Robinson castaway at desert-island.demon.co.uk
Tue Feb 7 13:49:24 CET 2006


No, it's not the same. Your $person (result of search), is a ResultSet, 
which allows updates via hashref. The user->user obj is just a Row, whic 
does not (update just updates dirty_columns), so you need to set them 
individually like so:

 foreach my $col (keys %$valid_result) {
   $c->user->user->set_column($col, $valid_result{$col}); 
 }
 $c->user->user->update;

So try that..

Jess

On Tue, 7 Feb 2006, Wijnand Wiersma wrote:

> 
> Op 7-feb-2006, om 11:41 heeft Yuval Kogman het volgende geschreven:
> > 
> > $person and $c->user->user are essentially the same thing here.
> 
> Ah, so
> $c->user->user->update($valid_results);
> is the same as
> $person->update($valid_results); ?
> 
> It doesn't seem to update anything.
> 
> > It's as if you just did
> > 
> >      $person = $model->search(
> >      username => $person->username,
> >      );
> > 
> Hmm, yes this sounds pretty dumb :-)
> 
> Wijnand
> 
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
> 
> 



More information about the Catalyst mailing list