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:
parent
4fea15dcfa
commit
fb56ef2d74
1 changed files with 8 additions and 0 deletions
|
@ -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|
|
||||
|
|
Loading…
Reference in a new issue