From eae7dc7f2e32bb1be39905cbe0184e21f55821d7 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 23 Dec 2019 12:23:46 +0100 Subject: [PATCH] Temporarily add extra debugging to help with strong parameters --- app/controllers/api/base_controller.rb | 6 ++++++ app/controllers/application_controller.rb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb index ac67bb6aa3..f591154d4c 100644 --- a/app/controllers/api/base_controller.rb +++ b/app/controllers/api/base_controller.rb @@ -32,6 +32,12 @@ module Api use_renderers :json check_authorization + # Temporary measure to help debugging strong_parameters + rescue_from ActiveModel::ForbiddenAttributesError, with: :print_params + def print_params + raise ActiveModel::ForbiddenAttributesError, params.to_s + end + def set_jsonp_format return unless params[:callback] && request.get? diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5b67897fab..fad20ce7aa 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,6 +10,12 @@ class ApplicationController < ActionController::Base include EnterprisesHelper include Spree::AuthenticationHelpers + # Temporary measure to help debugging strong_parameters + rescue_from ActiveModel::ForbiddenAttributesError, with: :print_params + def print_params + raise ActiveModel::ForbiddenAttributesError, params.to_s + end + def redirect_to(options = {}, response_status = {}) ::Rails.logger.error("Redirected by #{begin caller(1).first