From e2f72b445d7596cee1125040473df9b224ab8e83 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Mon, 2 Jun 2014 14:39:14 -0700 Subject: [PATCH] add validation for rating --- app/models/upload.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/upload.rb b/app/models/upload.rb index 1a3246d43..df1ed16b3 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -13,6 +13,7 @@ class Upload < ActiveRecord::Base after_destroy :delete_temp_file validate :uploader_is_not_limited, :on => :create validate :file_or_source_is_present, :on => :create + validates :rating, :presence => true attr_accessible :file, :image_width, :image_height, :file_ext, :md5, :file_size, :as_pending, :source, :file_path, :content_type, :rating, :tag_string, :status, :backtrace, :post_id, :md5_confirmation, :parent_id module ValidationMethods