mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 11:46:22 +00:00
fix: les invitades siempre crean borradores #17343
This commit is contained in:
parent
d3e09a2776
commit
cbe2f66a94
1 changed files with 2 additions and 1 deletions
|
@ -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|
|
||||||
|
|
Loading…
Reference in a new issue