[Dbix-class] Got a problem using DBIC+Params::Validate

Oleg Kostyuk cub.uanic at gmail.com
Fri Mar 26 16:20:47 GMT 2010


IIRC, evaluating ResultSet in scalar contex will issue count() call.
Your @_ contain $self as first paramenter.
Probably, you forget "my $self = shift" as first line of sub?...

2010/3/26 Konstantin A. Pustovalov <lamoz at adriver.ru>:
> Hi,
>
> I'm getting strange behavior with the following ResultSet class:
>
> <cut>
> package Test::Schema::ResultSet::User;
> use strict;
> use base 'DBIx::Class::ResultSet';
> use Params::Validate qw/:all/;
> sub touch {
>    validate_pos( @_, { isa => __PACKAGE__ } );
> }
>
> 1
> </cut>
>
> With this resultset class calling touch() issues 'SELECT COUNT( * ) FROM
> User me:'
>
>> Test::Schema->connect( 'dbi:SQLite:dbname=:memory:' )->resultset( 'User'
>> )->touch;
>
> What i'm doing wrong?
>
> DBIC version 0.08120
> Params::Validate version 0.95
>
> thnx!
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>



-- 
Sincerely yours,
Oleg Kostyuk (CUB-UANIC)



More information about the DBIx-Class mailing list