Open cornernote opened 9 years ago
I guess in the case of the error it doesnt really matter either way, since the model is bound directly to the panel anyway. It is a bit cleaner though, since the general idea is that the panels collect the data.
In the same way it has annoyed me a bit that the audit_data
records get saved by the AuditEntry
model, those do not belong there either.
In the same way it has annoyed me a bit that the audit_data records get saved by the AuditEntry model, those do not belong there either.
Could that be moved to a utility function?
Technically those should just be in the AuditData
-model.
But if we are making the models slimmer in favor of more intelligence in the Panels... Problem is obviously that that save would be called only once for all Panels.
I did Mail and Error panels, but when I tried to move the methods from AuditEntry to AuditData I was getting an error on the AuditEntryTest and I don't understand why. You might have to take a look at it.
Things like
AuditError::log()
andAuditMail::record()
may be better suited asprotected
methods in the panel classes, making our models very slim, and keeping all the panel logic in one place.I think the change is minor (but haven't fully investigated yet). What are your thoughts?