[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

self referential belongs_to

Aryk Grosz

6/26/2008 3:40:00 AM

I noticed that eager loading a belongs to association that points back
to an item of the same class is causing AR to lock up.

For example

class Layout < ActiveRecord::Base

belongs_to :flipped_layout, :class_name => "Layout", :foreign_key =>
"flipped_layout_id"
end

So when I do, Layout.find(:all, :include => :flipped_layout), it locks
up.

Am I doing something wrong or this a known bug with Rails?
--
Posted via http://www.ruby-....