fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

oil generated model no work before_update #203

Closed chatii closed 11 years ago

chatii commented 11 years ago

I try oil g model & save(), but no insert updated_at.

orm/observer/updatedat.php have before_save method, but no before_update.

https://github.com/fuel/oil/commit/4f72c706fdb9a556a132d9db96aa2ef6dd04b59b why changed?

WanWizard commented 11 years ago

I think it's the observer that is wrong, it used to run on before_save(), but that conflicts with the Observer_Typing, it should run later, and only on update, not on insert. before_save() runs on both...

WanWizard commented 11 years ago

I've updated the Observer to make it possible to use it on both before_save() and before_update(). Difference is that before_save() will update on insert too...

chatii commented 11 years ago

Thank you for reply and fix!!