Filling out an inherited mongoid document using nested attributes?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

Because I don't think the use of refereneces_many is encouraged -- Not that that's related to your problem here, just wanted to probe what version you're using. In the doc on the gorgeous Mongoid.Org, get this, I had to learn it the hard way, they say for Updating your records, you need to the autossave set to true. That's NOT accurate.

You need it for even creating.

Because I don't think the use of refereneces_many is encouraged -- Not that that's related to your problem here, just wanted to probe what version you're using. In the doc on the gorgeous Mongoid.Org, get this, I had to learn it the hard way, they say for Updating your records, you need to the autossave set to true. That's NOT accurate.

You need it for even creating so: class Company include Mongoid::Document has_many :workers, :autossave => true # your money shot accepts_nested_attributes_for :workers attr_accessible :workers_attributes end ADDED: I was re-reading your code, I spotted the following that might be the problem: Your Company model is set to has_many :workers and is set to accept nested attribbutes for Worker when changes come in, correct? And there is a field named Order in your Manager model which is subclassed from Worker. Yet you're having a form whose nested fields part is pointed at Worker not at Manager, the model that actually has the Order field.

And that's obviously not enough, because Company isn't having_many :managers yet, you may need to set it to has_many :managers in the Company model as well.

Updated to mongoid 2.2.1 and added autosave problem still persists. I think its related to the fact that nested attributes thinks it needs to fill the attributes for a worker when it needs to fill the attributes for a manager. I am not sure if there is a work around for that.

– GTDev Oct 3 at 8:07 Yes that is the problem but has_many ;managers is not the optimal solution I was looking for a way of getting to polymorphically determine the type of class. The question I'm asking is related to stackoverflow. Com/questions/2553931/… with mongoid instead of active record.

– GTDev Oct 3 at 15:55.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions