Fixed Issue with saving a child after it's retrieved from parent
Facility is my Root
SwimmingPool is a subclass
Problem:
Create a Facility of Type 'SwimmingPool'
SwimmingPool.create(:name => 'Dan Pool', :tldc_id => 97)
Retrieve it through root class
f = Facility.last
Save a change
f.name = 'tits'
f.save
BOOM
Our previous SwimmingPool now becomes a Facility type.
This was because when we fetch through the root we have no attributes from the child so it didn't update the child type when we saved the name change. The first run through the save that saves the root, chooses the type from the classname.
Fixed Issue with saving a child after it's retrieved from parent
Facility is my Root SwimmingPool is a subclass
Problem:
This was because when we fetch through the root we have no attributes from the child so it didn't update the child type when we saved the name change. The first run through the save that saves the root, chooses the type from the classname.
I have fixed this and it's in my fork.