このコミットが含まれているのは:
@@ -65,9 +65,10 @@ class PostBulkCreator
|
||||
PostCreatePreflight.new(
|
||||
attributes: attributes,
|
||||
thumbnail: thumbnail_for(index, attributes)).run
|
||||
if preflight[:existing_post].present?
|
||||
if preflight[:existing_post_id].present?
|
||||
return {
|
||||
status: 'skipped',
|
||||
existing_post_id: preflight[:existing_post_id],
|
||||
existing_post: preflight[:existing_post] }
|
||||
end
|
||||
|
||||
@@ -91,6 +92,7 @@ class PostBulkCreator
|
||||
if existing_post.present?
|
||||
return {
|
||||
status: 'skipped',
|
||||
existing_post_id: existing_post[:id],
|
||||
existing_post: existing_post }
|
||||
end
|
||||
|
||||
@@ -104,6 +106,7 @@ class PostBulkCreator
|
||||
existing_post = existing_post_for_race(attributes)
|
||||
return {
|
||||
status: 'skipped',
|
||||
existing_post_id: existing_post[:id],
|
||||
existing_post: existing_post } if existing_post.present?
|
||||
end
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ class PostCreatePreflight
|
||||
video_ms: preview[:attributes]['video_ms'],
|
||||
field_warnings: final_field_warnings(preview[:field_warnings] || { }),
|
||||
base_warnings: preview[:base_warnings],
|
||||
existing_post_id: preview[:existing_post_id],
|
||||
existing_post: existing_post_compact(preview[:existing_post_id]) }
|
||||
end
|
||||
|
||||
@@ -70,6 +71,7 @@ class PostCreatePreflight
|
||||
normalised_parent_post_ids: plan[:normalised_parent_post_ids],
|
||||
field_warnings: final_field_warnings(preview[:field_warnings] || { }),
|
||||
base_warnings: preview[:base_warnings],
|
||||
existing_post_id: preview[:existing_post_id],
|
||||
existing_post: existing_post_compact(preview[:existing_post_id]) }
|
||||
end
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class PostThumbnailUploadValidator
|
||||
|
||||
attachment = Post.resized_thumbnail_attachment(thumbnail, content_type: thumbnail.content_type)
|
||||
attachment[:io].close if attachment[:io].respond_to?(:close)
|
||||
rescue MiniMagick::Error
|
||||
rescue MiniMagick::Error, Timeout::Error
|
||||
raise InvalidUpload, 'サムネイル画像の変換に失敗しました.'
|
||||
ensure
|
||||
thumbnail&.rewind if thumbnail.respond_to?(:rewind)
|
||||
|
||||
新しい課題から参照
ユーザをブロックする