5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 14:06:21 +00:00

fix: no cambiar el post si lo asignamos antes

This commit is contained in:
f 2024-06-04 17:07:43 -03:00
parent 41ad7d806e
commit 3983f17ba2
No known key found for this signature in database

View file

@ -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)