5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 01:16:23 +00:00

fix: les invitades siempre crean borradores #17343

This commit is contained in:
f 2024-09-06 14:11:49 -03:00
parent d3e09a2776
commit cbe2f66a94
No known key found for this signature in database

View file

@ -26,8 +26,9 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
# @return Post # @return Post
def create def create
self.post ||= site.posts(lang: locale).build(layout: layout) self.post ||= site.posts(lang: locale).build(layout: layout)
params[base][:draft] = true if site.invitade? usuarie
post.usuaries << usuarie post.usuaries << 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|