From bb4f92a475929e7be354bd30de7a8a033cb9abe8 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 2 Sep 2024 15:21:28 -0300 Subject: [PATCH] fix: no todos los esquemas tienen borrador --- app/services/post_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/post_service.rb b/app/services/post_service.rb index 5f27211d..920c912e 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -27,7 +27,7 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do def create self.post ||= site.posts(lang: locale).build(layout: layout) post.usuaries << usuarie - post.draft.value = true if site.invitade? usuarie + post.draft.value = true if post.attribute?(:draft) && site.invitade?(usuarie) post.assign_attributes(post_params) params.require(base).permit(:slug).tap do |p|