aplicar filtro de categorias antes de verificar que le usuarie pueda ver el articulo

This commit is contained in:
f 2019-11-06 18:43:03 -03:00
parent b0cffa9cfb
commit 3c8babb7d4
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D

View file

@ -31,13 +31,13 @@
%table.table.table-condensed.table-draggable
%tbody
- @posts.each_with_index do |post, i|
- next unless policy(post).show?
-#
saltearse el post a menos que esté en la categoría por
la que estamos filtrando
- if @category
- next unless post.attributes.include? :categories
- next unless post.categories.value.include?(@category)
- next unless policy(post).show?
%tr
%td
.handle