Skip calculating fingerprint when it is not used
The MD5 sum of an attachment is only necessary if the model has a corresponding _fingerprint column. If this column is absent, there is no need to calculate the MD5, which can be an expensive operation for large files. Accomplish this by deferring the fingerprint calculation using a block. If the _fingerprint column is absent, the block is never called, and the calculation is avoided.
Showing
Please
register
or
sign in
to comment