phurni / mortimer-poignant

Eloquent on steroids, implements RoR like ActiveRecord features as traits, including in-model validations, user stamping, declarative relations, cascaded operations on relations (save, delete).
MIT License
1 stars 1 forks source link

ExistingAttributesPersistence model collisions #4

Closed xire28 closed 9 years ago

xire28 commented 9 years ago

All models use $ExistingAttributesPersistence_tableColumns defined as class variable in Mortimer\Poignant\Model to store their existing column names. When the model eloquent.saving event handler tries to access the variable later, $ExistingAttributesPersistence_tableColumns contains the columns of the last model that called bootExistingAttributesPersistence.

As a result, ExistingAttributesPersistence trait deletes all model attributes in most cases.

phurni commented 9 years ago

Good catch! Thanx for the smart fix also.