5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 13:56:22 +00:00

fix: no todos los esquemas tienen borrador

This commit is contained in:
f 2024-09-02 15:21:28 -03:00
parent 51ba426a49
commit bb4f92a475
No known key found for this signature in database

View file

@ -27,7 +27,7 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
def create def create
self.post ||= site.posts(lang: locale).build(layout: layout) self.post ||= site.posts(lang: locale).build(layout: layout)
post.usuaries << usuarie 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) post.assign_attributes(post_params)
params.require(base).permit(:slug).tap do |p| params.require(base).permit(:slug).tap do |p|