I think, you just need to join twice with tags table, and this will
give you what you want:
my $product_rs = $schema->resultset('Product')->search_rs(
{ # conditions will be AND'ed by default
'product_tags.tag_id' => 'tagA',
'product_tags_2.tag_id' => 'tagB',
}, {
join => [ 'product_tags', 'product_tags' ],
}
);
For manuals, see here:
http://search.cpan.org/~ribasushi/DBIx-Class-0.08112/lib/DBIx/Class/Manual/Joining.pod#Joining_to_the_same_table_twice
PS: I will not be surprised, if this variant will be faster than all other ;)
--
Sincerely yours,
Oleg Kostyuk (CUB-UANIC)
_______________________________________________
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/[email protected]