mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 02:01:42 +00:00
los articulos editados por invitades siempre son borradores
This commit is contained in:
parent
5f3bbbfb1f
commit
8896c18ef9
1 changed files with 3 additions and 0 deletions
|
@ -11,6 +11,7 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
|
|||
# TODO: Implementar layout
|
||||
self.post = site.posts(lang: params[:post][:lang] || I18n.locale).build
|
||||
post.usuaries << usuarie
|
||||
params[:post][:draft] = true if site.invitade? usuarie
|
||||
|
||||
commit(action: :created) if post.update(post_params)
|
||||
|
||||
|
@ -21,6 +22,8 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
|
|||
|
||||
def update
|
||||
post.usuaries << usuarie
|
||||
params[:post][:draft] = true if site.invitade? usuarie
|
||||
|
||||
commit(action: :updated) if post.update(post_params)
|
||||
|
||||
# Devolver el post aunque no se haya salvado para poder rescatar los
|
||||
|
|
Loading…
Reference in a new issue