diff --git a/app/services/post_service.rb b/app/services/post_service.rb index 32614254..2b7df163 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -27,8 +27,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|