From 3a7b25ba1ae26664afb0ab31da49b46e85f859b7 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 13 Jan 2012 18:38:06 -0500 Subject: [PATCH] fixes #252 --- app/models/upload.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/upload.rb b/app/models/upload.rb index bfcf34d18..b5f9f17d2 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -18,7 +18,7 @@ class Upload < ActiveRecord::Base module ValidationMethods def uploader_is_not_limited if !uploader.can_upload? - update_attribute(:status, "error: uploader has reached their daily limit") + raise "uploader has reached their daily limit" end end @@ -30,19 +30,19 @@ class Upload < ActiveRecord::Base def validate_file_exists unless File.exists?(file_path) - update_attribute(:status, "error: file does not exist") + raise "file does not exist" end end def validate_file_content_type unless is_valid_content_type? - update_attribute(:status, "error: invalid content type (#{file_ext} not allowed)") + raise "invalid content type (#{file_ext} not allowed)" end end def validate_md5_confirmation if !md5_confirmation.blank? && md5_confirmation != md5 - update_attribute(:status, "error: md5 mismatch") + raise "md5 mismatch" end end end