From cbe2f66a94902b1b2ba6a2aafc1dcf7af489034b Mon Sep 17 00:00:00 2001 From: f Date: Fri, 6 Sep 2024 14:11:49 -0300 Subject: [PATCH] fix: les invitades siempre crean borradores #17343 --- app/services/post_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/post_service.rb b/app/services/post_service.rb index 920c912e..a0b891a2 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -26,8 +26,9 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do # @return Post def create self.post ||= site.posts(lang: locale).build(layout: layout) + params[base][:draft] = true if site.invitade? usuarie + post.usuaries << 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|