[Dbix-class] relationship with additional constraints?

Stuart Dodds dodds at united-domains.de
Fri May 18 07:52:09 GMT 2018


On 17/05/18 22:25, Matt S Trout wrote:
> Surely http://p3rl.org/DBIx::Class::ParameterizedJoinHack is exactly
> what's needed here - just use it on a belongs_to rel with a join_type of
> left so non-matching entries are still returned, then prefetch that rel?
> 
> (ironic since I'm replying to the man who was kind enough to sponsor Shadowcat
> to develop that module in the first place :)
> 

Yes, I tried it yesterday and it is (almost) exactly what I need, thank you!

I say "almost" because my use case actually calls for a might_have relationship (rather than has_many) but it is easy enough to ->first off the entry in the rs.

Stuart



More information about the DBIx-Class mailing list