5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 01:51:41 +00:00

Al filtrar PostRelation devolver otra

This commit is contained in:
f 2020-10-01 09:17:04 -03:00
parent 4fea15dcfa
commit fb56ef2d74

View file

@ -115,6 +115,14 @@ class PostRelation < Array
end]
end
# Como Array#select devolviendo una relación
#
# @return [PostRelation]
alias array_select select
def select(&block)
PostRelation[*array_select(&block)]
end
# Intenta guardar todos y devuelve true si pudo
def save_all(validate: true)
map do |post|