From b3ed65b340dff909001ccd699944d6ee8c424e93 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 23 Apr 2024 14:11:58 -0300 Subject: [PATCH] fix: primero guardar para que se actualicen las relaciones --- app/services/post_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/post_service.rb b/app/services/post_service.rb index 90aa9401..84f58dad 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -19,9 +19,10 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do # Crea los posts anidados create_nested_posts! post, params[:post] + post.save update_related_posts - commit(action: :created, add: files) if post.save + commit(action: :created, add: files) update_site_license!