[Dbix-class] Multiple belongs_to relationships referencing same class

Jess Robinson castaway at desert-island.me.uk
Tue May 1 22:20:54 GMT 2007


On Tue, 1 May 2007, Tobias Kremer wrote:

> Hi Jess,
>
>> I've not quite understood most of this thread, but it sounds like what you 
>> want is:
>> 
>> Table with user1_id, user2_id,
>> 
>> query that returns all user2_id matching a given user_id AND returns all 
>> user1_id that match when user2_is the given user_id.. correct?
>> 
>
> Exactly! :)
>
>> I have this with DBIC, no unions involved ;)
>
> Damn, it looks like this works perfectly! I was gonna give up on DBIC but 
> this
> just saved my day ... :)
>
> Thanks a lot, man!
>

Wo-man, bitte ;)

Jess




More information about the Dbix-class mailing list