Hi Adam,

Did you try putting result-set in the variable rather than directly putting
it into stash?

my $user = $c->model('DB::Tech')->find({id => $userid});
$user->update({ id => $username,
                               firstname => $fname,
                               lastname => $lname,
                               email => $email,
                               phone => $phone,});

Try this and let us know

On Sun, Apr 3, 2011 at 12:07 AM, Adam Jimerson <[email protected]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> First of all hello people of the list!
>
> I am working on my first Catalyst app and need some help updating an
> entry from my database.
>
> $c->stash( users_rs => $c->model('DB::Tech'));
> my $user = $c->stash->{users_rs}->find({ id => $userid });
>   die "No such user: $userid\n" if (!$user);
> $c->stash(user => $user);
> $c->log->debug('Before update');
> $user->update({
>                                id => $username,
>                                firstname => $fname,
>                                lastname => $lname,
>                                email => $email,
>                                phone => $phone,
>                        });
> $c->log->debug('After update');
>
> In the debug output from Catalyst I can see where the "Before update"
> gets printed but fails with no error that I can see during the update.
> Any help or advice in this matter would be greatly appreciated.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2XbNAACgkQsK1mqepTLy9JNACeIsj8CR0d6utPMLRpgZQEs2+X
> N8UAnicZ07JpEK6kCxtwHdYGd+hW6VQt
> =NuEZ
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>



-- 
रोहन मल्लेल्रवार
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to