5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-26 15:26:07 +00:00

no fallar si el artículo no tiene orden

This commit is contained in:
f 2020-05-26 16:43:20 -03:00
parent 03143096ed
commit a9ee06f1a3

View file

@ -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