aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-11-19 10:20:52 +0000
committerGareth Rees <gareth@mysociety.org>2014-11-19 11:27:22 +0000
commitbb233e381c2607788a91534a46c89f5fae6dce06 (patch)
tree5fba1c105750b4af0970f0348e6056511a2d28b6 /app/controllers
parentb18582f2fd854a6c42a25ec82202d7d4bc675008 (diff)
Associate censor rule with something in #new
Build the CensorRule against the object that is found by an additional parameter (either :info_request_id or :user_id)
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin_censor_rule_controller.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/admin_censor_rule_controller.rb b/app/controllers/admin_censor_rule_controller.rb
index cca678867..c5d2b16c1 100644
--- a/app/controllers/admin_censor_rule_controller.rb
+++ b/app/controllers/admin_censor_rule_controller.rb
@@ -8,9 +8,11 @@ class AdminCensorRuleController < AdminController
def new
if params[:info_request_id]
@info_request = InfoRequest.find(params[:info_request_id])
+ @censor_rule = @info_request.censor_rules.build
end
if params[:user_id]
@censor_user = User.find(params[:user_id])
+ @censor_rule = @censor_user.censor_rules.build
end
@censor_rule ||= CensorRule.new