[Dbix-class] "Deletion" of records by setting status to 'deleted'

Ilya Chesnokov chesnokov.ilya at gmail.com
Tue Mar 10 14:31:27 GMT 2015


2015-03-10 12:45 GMT+03:00 Dmitry Latin <dim0xff at gmail.com>:
> Hi!
>
>> First I tried to override search_rs() method in a custom resultset
>> with something like this:
>> https://gist.github.com/ichesnokov/1d4236f79c69fd14ebbe, but it didn't
>> work as expected on prefetches with condition in them.
>>
> I think this way doesn't work on prefetches because it shouldn't.

Why?

> In addition to overriding search_rs, you have to provide conditions into
> relations (https://metacpan.org/pod/DBIx::Class::Relationship::Base#Custom-join-conditions)

This seems irrelevant to my issue: I don't need custom joins, I only
want to have what DBIx::Class provides by default.

By "prefetches with condition" I mean expressions with both "prefetch"
and "where" attributes, similar to this:

$customer->find(
    $id,
    {
        prefetch => 'services',
        where => { 'services.entity' => 'abcd' },
    }
);

> --
> //wbr, Dmitry Latin
>
> _______________________________________________
> 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



-- 
Best regards,
Ilya Chesnokov



More information about the DBIx-Class mailing list