From e5f56c19c07a7ea6defab5202ab0277d8902ba98 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sat, 21 Mar 2020 20:00:26 +0000 Subject: [PATCH] Switch to using PermittedAttributes::Address instead of spree version of it that will be removed later --- app/controllers/admin/customers_controller.rb | 4 ++-- app/controllers/admin/enterprise_groups_controller.rb | 2 +- app/controllers/admin/enterprises_controller.rb | 2 +- .../spree/admin/orders/customer_details_controller.rb | 4 ++-- app/services/permitted_attributes/address.rb | 2 ++ 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/customers_controller.rb b/app/controllers/admin/customers_controller.rb index 2a600db3bd..d4cf9b15fe 100644 --- a/app/controllers/admin/customers_controller.rb +++ b/app/controllers/admin/customers_controller.rb @@ -84,8 +84,8 @@ module Admin def customer_params params.require(:customer).permit( :enterprise_id, :name, :email, :code, :tag_list, - ship_address_attributes: permitted_address_attributes, - bill_address_attributes: permitted_address_attributes, + ship_address_attributes: PermittedAttributes::Address.attributes, + bill_address_attributes: PermittedAttributes::Address.attributes, ) end diff --git a/app/controllers/admin/enterprise_groups_controller.rb b/app/controllers/admin/enterprise_groups_controller.rb index f926852f6f..5483cdd45e 100644 --- a/app/controllers/admin/enterprise_groups_controller.rb +++ b/app/controllers/admin/enterprise_groups_controller.rb @@ -60,7 +60,7 @@ module Admin params.require(:enterprise_group).permit( :name, :description, :long_description, :on_front_page, :owner_id, :permalink, :email, :website, :facebook, :instagram, :linkedin, :twitter, - enterprise_ids: [], address_attributes: permitted_address_attributes + enterprise_ids: [], address_attributes: PermittedAttributes::Address.attributes ) end end diff --git a/app/controllers/admin/enterprises_controller.rb b/app/controllers/admin/enterprises_controller.rb index 4d2ea81eb2..518a8453a9 100644 --- a/app/controllers/admin/enterprises_controller.rb +++ b/app/controllers/admin/enterprises_controller.rb @@ -319,7 +319,7 @@ module Admin :allow_guest_orders, :allow_order_changes, :enable_subscriptions, group_ids: [], user_ids: [], shipping_method_ids: [], payment_method_ids: [], - address_attributes: permitted_address_attributes, + address_attributes: PermittedAttributes::Address.attributes, producer_properties_attributes: [:id, :property_name, :value, :_destroy] ) end diff --git a/app/controllers/spree/admin/orders/customer_details_controller.rb b/app/controllers/spree/admin/orders/customer_details_controller.rb index 989e73fa46..4537f828a6 100644 --- a/app/controllers/spree/admin/orders/customer_details_controller.rb +++ b/app/controllers/spree/admin/orders/customer_details_controller.rb @@ -45,8 +45,8 @@ module Spree params.require(:order).permit( :email, :use_billing, - :bill_address_attributes => permitted_address_attributes, - :ship_address_attributes => permitted_address_attributes + bill_address_attributes: PermittedAttributes::Address.attributes, + ship_address_attributes: PermittedAttributes::Address.attributes ) end diff --git a/app/services/permitted_attributes/address.rb b/app/services/permitted_attributes/address.rb index 4fd7908297..4c7a538caf 100644 --- a/app/services/permitted_attributes/address.rb +++ b/app/services/permitted_attributes/address.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module PermittedAttributes class Address def self.attributes