FAQ

Ian Docherty wrote:
As I mentioned, if I try to do a call to
$c->model('DBIC::UsedPassword')->create_limited( ... ); I get the
fatal error

Can't locate object method "create_limited" via package
"DBIx::Class::ResultSet

Which is why I think this is not the approach, unless you know otherwise?
I'm not sure I would structure the code exactly like you did. I think I
would add a method to the User class like:

package My::Schema::User;
...
sub set_password { txn_do(update current password, update used
passwords) }

Then you can say something like:

$c->model('DBIC::Users')->find(42)->set_password('foobarbaz');

and have everything work.

Finally, if you want your create_limited to work, try:

package My::ResultSet::UsedPassword;
use base 'DBIx::Class::ResultSet';
sub create_limited { ... };

package My::Schema::UsedPassword;
__PACKAGE__->resultset_class('My::ResultSet::UsedPassword');

Regards,
Jonathan Rockway

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 370 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070913/e31e7ca4/signature.pgp

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 12 of 17 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedSep 13, '07 at 10:27a
activeSep 14, '07 at 1:35p
posts17
users6
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase