uploads: replace old upload limits with new upload limits.
This commit is contained in:
@@ -60,7 +60,6 @@ class Upload < ApplicationRecord
|
||||
|
||||
before_validation :initialize_attributes, on: :create
|
||||
before_validation :assign_rating_from_tags
|
||||
validate :uploader_is_not_limited, on: :create
|
||||
# validates :source, format: { with: /\Ahttps?/ }, if: ->(record) {record.file.blank?}, on: :create
|
||||
validates :rating, inclusion: { in: %w(q e s) }, allow_nil: true
|
||||
validates :md5, confirmation: true, if: ->(rec) { rec.md5_confirmation.present? }
|
||||
@@ -235,12 +234,6 @@ class Upload < ApplicationRecord
|
||||
extend SearchMethods
|
||||
include SourceMethods
|
||||
|
||||
def uploader_is_not_limited
|
||||
if !uploader.can_upload?
|
||||
errors.add(:uploader, uploader.upload_limited_reason)
|
||||
end
|
||||
end
|
||||
|
||||
def assign_rating_from_tags
|
||||
if rating = Tag.has_metatag?(tag_string, :rating)
|
||||
self.rating = rating.downcase.first
|
||||
|
||||
Reference in New Issue
Block a user