5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 19:36:22 +00:00

fix: mantener una lista única de archivos

This commit is contained in:
f 2023-10-26 16:43:16 -03:00
parent 82fdf2518e
commit 0dc3a69a93
No known key found for this signature in database

View file

@ -16,7 +16,6 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
end end
if post.update(post_params) if post.update(post_params)
added_paths = []
added_paths << post.path.value added_paths << post.path.value
# Recorrer todas las asociaciones y agregarse donde corresponda # 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 = []
rm << post.path.value_was if post.path.changed? rm << post.path.value_was if post.path.changed?
added_paths = []
added_paths << post.path.value added_paths << post.path.value
# Recorrer todas las asociaciones y agregarse donde corresponda # 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
end end
# @return [Array<String>] # @return [Set<String>]
def associated_posts_to_save def associated_posts_to_save
@associated_posts_to_save ||= Set.new @associated_posts_to_save ||= Set.new
end end
# @return [Set<String>]
def added_paths
@added_paths ||= Set.new
end
# Recolectar campos asociados que no estén vacíos # Recolectar campos asociados que no estén vacíos
# #
# @param [Post] # @param [Post]