With the latest build (cd5add332e098ef263a25ce43fa37f1ef78505f1) I
still have a problem with has_many through associations.
I have
class Sale
has_many :bid_requests, :dependent => :destroy
has_many :bidders, :class_name=>'User', :uniq=>true, :through=>:bid_requests, 
:source=>:user,
    :conditions=>'(status="Accepted")'
In the Sale list the Bidders list are shown in a nested list that has
on top a button ("Add a New Bidder") that invoke the create action.
When I click that button I got 500 Internal error in the view and in
the log file the following error is displayed:

NoMethodError (undefined method `sale=' for []:Array):
  -e:1:in `load'
  -e:1

it seems that it is trying to set the Sale parent directly to the
Bidder(User), but the User doesn't have any Sale. Is the BidRequest
that has the Sale.

Is this is the normal behavior or is a bug?


On Jul 20, 10:58 am, "Sergio Cambra .:: entreCables S.L. ::."
<[email protected]> wrote:
> On Viernes, 17 de Julio de 2009 23:49:34 David Cato escribió:
>
> > Sergio Cambra .:: entreCables S.L. ::. wrote ...
> > > Thanks, I have committed a fix for it, it's a similar fix. I don't use
> > > has_many
>
> > > :through, can you try it?
>
> > Works great as long as the first record has an empty list of associated
> > records, but fails with the same error as the original code if there are
> > any associated records.
>
> Update and try it again please
>
> --
> 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