# Assuming a user has many files relationship @user.uploads.sum(:image_file_size)
至于实际强加上限,我建议在任何文件模型上创建自定义验证,以便您可以将错误和问题传递回客户端.