[Dbix-class] resultset_attributes, where, undef - wotz up?
Moritz Onken
onken at houseofdesign.de
Fri Jul 16 10:08:54 GMT 2010
Am 16.07.2010 um 10:18 schrieb Benjamin Martin:
> Hello everyone,
>
> I have a ResultSet where I have used the 'resultset_attributes' to restrict which records get returned from search etc. ... ala the documentation:
>
> __PACKAGE__->resultset_attributes({ where => { deleted => undef } });
>
> In one part of the system I would like to access these restricted records but I can't seem to get it to work!
>
> $schema->resultset('TableA')->search( {}, { where => undef } );
Try
$schema->resultset('TableA')->search( {}, { where => { deleted => { '!=' => undef } } } );
which will result in a WHERE "deleted" IS NOT NULL;
cheers,
mo
More information about the DBIx-Class
mailing list