FAQ
My application has (effectively, subject to some cut and paste) the
following.

################

package MyApp::Schema;

use strict;
use warning;

use base qw(DBIx::Class::Schema);

__PACKAGE__->load_classes(qw(
UsedPassword
));
1;

################

package MyApp::Schema::UsedPassword;

use strict;
use warning;

use base qw(DBIx::Class);

__PACKAGE__->load_components(qw(PK::Auto Core));
__PACKAGE__->table('used_password');
__PACKAGE__->add_columns(qw(id user password));
__PACKAGE__->set_primary_key('id');

sub create_limited {
my ($self, $user, $password) = @_;

# password checking logic here
}
1;

################

package MyApp::Model::DBIC;

use strict;
use warning;

use base qw(Catalyst::Model::DBIC::Schema);

__PACKAGE__->config(
schema_class => 'MyApp::Schema',
connect_info => [
MyApp->config->{db},
MyApp->config->{db_user},
MyApp->config->{db_password},
{AutoCommit => 1, quote_char => '`', name_sep => '.'},
]);
1;

################

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?

Regards
Ian

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 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