Here is my stand alone script i just tried, still putting NIL in the contactable columns: I even tried person.contactable.save to no avail.
RAILS_ENV = 'development' require File.dirname(__FILE__) + '/../config/boot' require File.dirname(__FILE__) + '/../config/environment' @contact = Contact.create(:name => 'moo') @contact.save person = Person.create(:company_id => '1') person.save person.contactable = @contact 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 -~----------~----~----~----~------~----~------~--~---

