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|