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

fix: mantener una lista única de archivos

(cherry picked from commit 0dc3a69a93)
This commit is contained in:
f 2023-10-26 16:43:16 -03:00
parent 84d7b8f7c0
commit ed1fd9cdef
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
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<String>]
# @return [Set<String>]
def associated_posts_to_save
@associated_posts_to_save ||= Set.new
end
# @return [Set<String>]
def added_paths
@added_paths ||= Set.new
end
# Recolectar campos asociados que no estén vacíos
#
# @param [Post]