petehamilton / citier

CITIER (Class Inheritance & Table Inheritance Embeddings for Rails) is a solution for simple Multiple Class Inheritance in Rails.
88 stars 24 forks source link

Combine Parent.save and Child.save to the same transaction. #61

Open sishen opened 12 years ago

sishen commented 12 years ago

When the parent record saved, we already get the id of the child record. If we do the query before child record persisted into the table, it will raise RecordNotFound exception.

I tried to combine Parent save and Child save into the same transaction and then the problem gone. I'm not sure whether there will be side effects yet and will keep monitoring how it works in the server.

sishen commented 12 years ago

Any thoughts on this PR? Thanks.