Erwin1
(Erwin)
1
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
Tim_Uckun
(Tim Uckun)
2
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.