Closed Bouwdie closed 8 years ago
Not true. We only call persist if you return a truthy value from the callback indicating your modified it and need to persist the changes to the db.
That is true, but why call persist before the callback has been invoked at all. This causes unnecessary exceptions if you plan to invoke some specific logic in the callback to make your model valid.
Because some people were doing things in the callback that needed it saving first.
That scenario would be valid indeed. Situation all clear then :smile: Thx for the fast reply.
Persist is currently called before and after the callback invocation. The callback might actually be used by implementations to set required values on the object. Maybe we could even use the ::instance function?