On Aug 18, 6:24 pm, IAmNan <[email protected]> wrote:
> Thanks, Fred. I think you've helped me out before. I appreciate your
> effort.
>
> I've put the relevant code here:http://pastie.org/1100297
>
> So you know what's happening, the farmer creates a Production, which
> creates one or more Supplies, which may create one or more Exchanges
> if there are any Demands that match the Supply.
>
> The Exchange is supposed to decrement the "available" variable in both
> the Supply and Demand models (the "quantity" variable doesn't change).
>
> On exchange.rb#18 where the debugger stops, the values of
> demand.available and supply.available have been correctly decremented.
> After I let the code continue, they are back to their original values.
>

 You don't seem to be saving the demand or supply objects after you
modify them in that after_save. Are you doing that somewhere else?

Fred



> Thanks again.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en.

Reply via email to