mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 00:56: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
|
||||
def create
|
||||
self.post = site.posts(lang: locale)
|
||||
.build(layout: layout)
|
||||
self.post ||= site.posts(lang: locale).build(layout: layout)
|
||||
post.usuaries << usuarie
|
||||
post.draft.value = true if site.invitade? usuarie
|
||||
post.assign_attributes(post_params)
|
||||
|
|
Loading…
Reference in a new issue