On Martes, 18 de Enero de 2011 11:02:57 Yuriy Padlyak escribió:
> Hello Sergio,
> 
> Yes, I have:
> 
> class Manufacture < ActiveRecord::Base
>         has_many :orders

You should have has_many :orders, :foreign_key => :planned_manufacture_id

> 
> On Jan 17, 6:17 pm, "Sergio Cambra .:: entreCables S.L. ::."
> 
> <[email protected]> wrote:
> > On Lunes, 17 de Enero de 2011 15:36:04 Yuriy Padlyak escribió:
> > > Hello All,
> > > 
> > > I'm getting:
> > > ActiveScaffold::ReverseAssociationRequired (Association orders: In
> > > order to support :has_one and :has_many where the parent record is new
> > > and the child record(s) validate the presence of the parent,
> > > ActiveScaffold requires the reverse association (the belongs_to).):
> > > 
> > >  My Order model actually has belongs_to:
> > >   belongs_to :manufacture, :class_name => "Manufacture", :foreign_key
> > > => "planned_manufacture_id"
> > > 
> > > When I change to just "belongs_to :manufacture", error doesn't show
> > > up, but I still need it to be:
> > >  belongs_to :manufacture, :class_name => "Manufacture", :foreign_key
> > > => "planned_manufacture_id"
> > > not:
> > >  belongs_to :manufacture
> > 
> > Have you set foreign_key in the has_one/has_many association too?
> > 
> > > Any ideas what could be wrong?
> > 
> > --
> > Sergio Cambra .:: entreCables S.L. ::.
> > Mariana Pineda 23, 50.018 Zaragoza
> > T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to