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)