このコミットが含まれているのは:
2026-07-18 17:44:56 +09:00
コミット 74b1ada0dd
5個のファイルの変更39行の追加28行の削除
+5 -3
ファイルの表示
@@ -1,8 +1,9 @@
class PostBulkCreator
def initialize actor:, posts:, thumbnails:
def initialize actor:, posts:, thumbnails:, host: nil
@actor_id = actor.id
@posts = posts
@thumbnails = thumbnails
@host = host
end
def run
@@ -64,7 +65,8 @@ class PostBulkCreator
preflight =
PostCreatePreflight.new(
attributes: attributes,
thumbnail: thumbnail_for(index, attributes)).run
thumbnail: thumbnail_for(index, attributes),
host: @host).run
if preflight[:existing_post_id].present?
return {
status: 'skipped',
@@ -195,6 +197,6 @@ class PostBulkCreator
end
def compact_existing_post post
PostCompactRepr.base(post)
PostCompactRepr.base(post, host: @host)
end
end
+3 -2
ファイルの表示
@@ -9,9 +9,10 @@ class PostCreatePreflight
end
end
def initialize attributes:, thumbnail: nil
def initialize attributes:, thumbnail: nil, host: nil
@attributes = attributes.symbolize_keys
@thumbnail = thumbnail
@host = host
end
def run
@@ -124,7 +125,7 @@ class PostCreatePreflight
return nil if post_id.blank?
post = Post.with_attached_thumbnail.find_by(id: post_id)
PostCompactRepr.base(post)
PostCompactRepr.base(post, host: @host)
end
def final_field_warnings field_warnings