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