mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 05:06:22 +00:00
fix: no cambiar el post si lo asignamos antes
This commit is contained in:
parent
41ad7d806e
commit
3983f17ba2
1 changed files with 1 additions and 2 deletions
|
@ -7,8 +7,7 @@ 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)
|
self.post ||= site.posts(lang: locale).build(layout: layout)
|
||||||
.build(layout: layout)
|
|
||||||
post.usuaries << usuarie
|
post.usuaries << usuarie
|
||||||
post.draft.value = true if site.invitade? usuarie
|
post.draft.value = true if site.invitade? usuarie
|
||||||
post.assign_attributes(post_params)
|
post.assign_attributes(post_params)
|
||||||
|
|
Loading…
Reference in a new issue