mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-29 21:06:22 +00:00
fix: mantener una lista única de archivos
(cherry picked from commit 0dc3a69a93
)
This commit is contained in:
parent
84d7b8f7c0
commit
ed1fd9cdef
1 changed files with 6 additions and 3 deletions
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue