From ee64cb61f9306a46ed2d1a6e21536f15d96904cb Mon Sep 17 00:00:00 2001 From: Chris Roos Date: Wed, 7 Mar 2018 15:27:57 +0000 Subject: [PATCH] Rename BaseAssetsController#handle_empty_access_limited_param As suggested by @floehopper. --- app/controllers/assets_controller.rb | 2 +- app/controllers/base_assets_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb index 461360d4..a8814fc4 100644 --- a/app/controllers/assets_controller.rb +++ b/app/controllers/assets_controller.rb @@ -39,7 +39,7 @@ def restrict_request_format def asset_params normalize_redirect_url( - handle_empty_access_limited_param(params) + normalize_access_limited(params) .require(:asset) .permit(:file, :draft, :redirect_url, :replacement_id, :parent_document_url, access_limited: []) ) diff --git a/app/controllers/base_assets_controller.rb b/app/controllers/base_assets_controller.rb index 94a63610..700055c4 100644 --- a/app/controllers/base_assets_controller.rb +++ b/app/controllers/base_assets_controller.rb @@ -22,7 +22,7 @@ def normalize_redirect_url(params) params.reject { |k, v| (k.to_sym == :redirect_url) && v.blank? } end - def handle_empty_access_limited_param(params) + def normalize_access_limited(params) if params.has_key?(:asset) && params[:asset].has_key?(:access_limited) && params[:asset][:access_limited].empty? params[:asset][:access_limited] = [] end