mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 01:51:41 +00:00
no fallar si el artículo no tiene orden
This commit is contained in:
parent
03143096ed
commit
a9ee06f1a3
1 changed files with 5 additions and 3 deletions
|
@ -43,9 +43,11 @@ class PostRelation < Array
|
|||
attrs.map do |attr|
|
||||
# TODO: detectar el tipo de atributo faltante y obtener el valor
|
||||
# por defecto para hacer la comparación
|
||||
return 0 unless post.attributes.include? attr
|
||||
|
||||
post.public_send(attr).value
|
||||
if post.attributes.include? attr
|
||||
post.public_send(attr).value
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue