Hi
I use STI and polymorphisme as following :
class Franchise < Company
....
has_one :notebook, :as => :notebookable, :dependent => :destroy
..
def after_create
...
self.create_notebook
end
class Notebook < ActiveRecord::Base
belongs_to :notebookable, :polymorphic => true
..
end
BUT the created notebook record has :notebookable_type =
''Company'',
whicj is not right, should be ''Franchise''...
is it correct or should I add another parameter somewhere ?
thanks for your advices..
erwin
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
> > I use STI and polymorphisme as following : > > class Franchise < Company > .... > has_one :notebook, :as => :notebookable, :dependent => :destroy > .. > def after_create > ... > self.create_notebook > end > > class Notebook < ActiveRecord::Base > belongs_to :notebookable, :polymorphic => true > .. > end > > BUT the created notebook record has :notebookable_type = ''Company'', > whicj is not right, should be ''Franchise''... > > is it correct or should I add another parameter somewhere ?Did you ever get an answer to this? I am faced with a similar problem. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---