Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
Attach a file by drag & drop or click to upload