The clipclip saves the file size.
That way, you can simply, for one user, do something like:
def used_file_size self.files.sum(:document_file_size) end
Then you will have the total size of all user documents.
Then you can add a maximum size limit and not check the document load if the user has reached that size.
Damien MATHIEU
source share