diff --git a/app/services/post_service.rb b/app/services/post_service.rb index da7673d0..6c10b044 100644 --- a/app/services/post_service.rb +++ b/app/services/post_service.rb @@ -16,7 +16,6 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do end if post.update(post_params) - added_paths = [] added_paths << post.path.value # Recorrer todas las asociaciones y agregarse donde corresponda @@ -55,7 +54,6 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do rm = [] rm << post.path.value_was if post.path.changed? - added_paths = [] added_paths << post.path.value # Recorrer todas las asociaciones y agregarse donde corresponda @@ -148,11 +146,16 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do end end - # @return [Array] + # @return [Set] def associated_posts_to_save @associated_posts_to_save ||= Set.new end + # @return [Set] + def added_paths + @added_paths ||= Set.new + end + # Recolectar campos asociados que no estén vacíos # # @param [Post]