mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 23:13:38 +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
|
# TODO: Implementar layout
|
||||||
self.post = site.posts(lang: params[:post][:lang] || I18n.locale).build
|
self.post = site.posts(lang: params[:post][:lang] || I18n.locale).build
|
||||||
post.usuaries << usuarie
|
post.usuaries << usuarie
|
||||||
|
params[:post][:draft] = true if site.invitade? usuarie
|
||||||
|
|
||||||
commit(action: :created) if post.update(post_params)
|
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
|
def update
|
||||||
post.usuaries << usuarie
|
post.usuaries << usuarie
|
||||||
|
params[:post][:draft] = true if site.invitade? usuarie
|
||||||
|
|
||||||
commit(action: :updated) if post.update(post_params)
|
commit(action: :updated) if post.update(post_params)
|
||||||
|
|
||||||
# Devolver el post aunque no se haya salvado para poder rescatar los
|
# Devolver el post aunque no se haya salvado para poder rescatar los
|
||||||
|
|
Loading…
Reference in a new issue