From 3983f17ba225680cb02d531bcbd9b94cc3dd1c36 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 4 Jun 2024 17:07:43 -0300 Subject: [PATCH] fix: no cambiar el post si lo asignamos antes --- app/services/post_service.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/services/post_service.rb b/app/services/post_service.rb index 93daaa45..3045bd9c 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -7,8 +7,7 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do # # @return Post def create - self.post = site.posts(lang: locale) - .build(layout: layout) + self.post ||= site.posts(lang: locale).build(layout: layout) post.usuaries << usuarie post.draft.value = true if site.invitade? usuarie post.assign_attributes(post_params)