mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 16:53:38 +00:00
Al filtrar PostRelation devolver otra
This commit is contained in:
parent
4fea15dcfa
commit
fb56ef2d74
1 changed files with 8 additions and 0 deletions
|
@ -115,6 +115,14 @@ class PostRelation < Array
|
||||||
end]
|
end]
|
||||||
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
|
# Intenta guardar todos y devuelve true si pudo
|
||||||
def save_all(validate: true)
|
def save_all(validate: true)
|
||||||
map do |post|
|
map do |post|
|
||||||
|
|
Loading…
Reference in a new issue