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|