このコミットが含まれているのは:
@@ -47,10 +47,9 @@ class PostImportPreviewer
|
||||
attributes[field] = value
|
||||
provenance[field] = 'automatic'
|
||||
end
|
||||
post = Post.new(url:)
|
||||
post.valid?
|
||||
normal_url = post.url
|
||||
errors = post.errors.to_hash.transform_values(&:dup)
|
||||
normal_url = normalised_url(url)
|
||||
errors = { }
|
||||
errors[:url] = ['URL が不正です.'] if normal_url.blank?
|
||||
validation_warnings = []
|
||||
errors[:url] = ['URL が重複しています.'] if normal_url.present? && urls.key?(normal_url)
|
||||
urls[normal_url] = true if normal_url.present?
|
||||
@@ -165,6 +164,7 @@ class PostImportPreviewer
|
||||
video_ms: parse_duration(attributes['duration'], errors))
|
||||
post.valid?
|
||||
post.errors.each { |error| (errors[error.attribute] ||= []) << error.message }
|
||||
errors.delete(:url)
|
||||
end
|
||||
|
||||
def parse_duration value, errors
|
||||
|
||||
新しい課題から参照
ユーザをブロックする