[Dbix-class] has_one joining through another table

Matt S Trout dbix-class at trout.me.uk
Thu Jun 28 00:56:15 GMT 2007


On Wed, Jun 27, 2007 at 11:58:40AM -0400, Steve Francia wrote:
> Thanks for the good advice and discussion.
> 
> So, taking your advice, actually brings it all back to the original
> question.
> I believe I understand what you are recommending.
> So I created a fk_user_picture_id in the picture table which identifies
> the owner through the user_picture table.
> 
> To me that is a has_one relationship between picture and user through
> the user_picture table, which is actually the root question that started
> this discussion.

It's a foreign key so it should be a belongs_to

Everything else, prefetch and proxy should be able to fix.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Dbix-class mailing list