I'm attempting to select the userid and count(*) from my Users table where username=$q->param('username') and password=$q->param('password'), using the following code:
my $user = $schema->resultset('User')->single(
{
username => $q->param('username'),
password => $q->param('password')
},
{
select => [
'userid', { count => '*' }
],
as => [qw/userid is_authorized/],
}
);
my $userid = $user->userid;
my $authenticated = $user->is_authorized eq '1' ? 1 : 0;
I'm getting this error:
"Can't locate object method "is_authorized" via package "Notes::DBI::User" at Notes.pm line 323"
Line 323 is my $authenticated = $user->is_authorized eq '1' ? 1 : 0;. I've read the docs, but have had no success in grokking them or getting things to work.
Ideas?
--
timorperfectus.com - web design to frightening perfection.
One last song
Given to an Angel's Son
As soon as you were gone
As soon as you were gone
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
