Deal gracefully with recommendations of hidden proposals

We were seeing an exceptions in the home page when displaying
recommendations. This was due to trying to load tags of hidden proposals

With this commit we are skipping proposals that that have been hidden,
which will hopefully solve this exception
This commit is contained in:
rgarcia
2018-05-10 15:38:46 +02:00
committed by decabeza
parent f7f1f12b82
commit f670019325
2 changed files with 11 additions and 1 deletions

View File

@@ -328,7 +328,8 @@ class User < ActiveRecord::Base
end
def interests
follows.map{|follow| follow.followable.tags.map(&:name)}.flatten.compact.uniq
followables = follows.map(&:followable)
followables.compact.map { |followable| followable.tags.map(&:name) }.flatten.compact.uniq
end
private