Ok, I did a new method instead of create and then the last thing I did was a save and it works. Anybody know why?
On Apr 19, 9:14 pm, Me <[email protected]> wrote: > I did the example in rails recipe. I can retrieve the addressable_id > and type when I create itfrom the console, but when I go log out and > go back and try to retrieve them they give back NIL just like the DB > shows. Is the ID and TYPE supposed to show up in the DB? I am still > getting NIL for the polymorphic columns. Stumped... > > On Apr 19, 7:18 pm, Chris Habgood <[email protected]> wrote: > > > Ok, I was looking at the DB for the contactable.type and id. Why does it > > not show up there but when you query it is is there? > > > On Sun, Apr 19, 2009 at 12:27 PM, Frederick Cheung < > > > [email protected]> wrote: > > > > On Apr 19, 1:50 am, Me <[email protected]> wrote: > > > > person = Person.create(params[:person]) > > > > @contact = Contact.create(params[:contact]) > > > > person.contactable = @contact > > > > > It goes without an error but puts NIL in the contactable_type and > > > > contactable_id columns. > > > > > Anyone have an idea why? I spent a couple hours with this earlier. > > > > Are you saving the person record after having assigned the > > > contactable ? > > > > Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

