Has anyone had any experience of using nested attributes with
polymorphic associations ? I cannot see how it would work as the
model would need to know the class of the object to create (when
creating a new record for the association).
Here is an example
class MyClass < ActiveRecord::Base
belongs_to :owner, :polymorphic=>true
This generates a method called ‘owner_attributes=’ which is fair
enough, but it does not generate the method ‘build_owner’ which is
required by the looks of it.
So, if I try using owner_attributes=, then straight away it complains
that the method build_owner is missing.