diff --git a/app/models/post_relation.rb b/app/models/post_relation.rb index e262893..1071234 100644 --- a/app/models/post_relation.rb +++ b/app/models/post_relation.rb @@ -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