From 77fbd2318e3e99ac91eac8e68d4dade480784ff7 Mon Sep 17 00:00:00 2001 From: kikito Date: Sun, 13 Sep 2015 19:43:44 +0200 Subject: [PATCH] Makes blocking an author also block his proposals --- app/models/user.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index a518ec8d4..657e3123b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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