Makes blocking an author also block his proposals

This commit is contained in:
kikito
2015-09-13 19:43:44 +02:00
parent 08dfa982eb
commit 77fbd2318e

View File

@@ -128,10 +128,13 @@ class User < ActiveRecord::Base
def block
debates_ids = Debate.where(author_id: id).pluck(:id)
comments_ids = Comment.where(user_id: id).pluck(:id)
proposal_ids = Proposal.where(author_id: id).pluck(:id)
self.hide
Debate.hide_all debates_ids
Comment.hide_all comments_ids
Proposal.hide_all proposal_ids
end