From a655d3d787684a0df7d7a2016c633272d6d18d94 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 15 Jun 2023 11:30:52 +1000 Subject: [PATCH] Remove unnecessary writes on customer creation The form only submits enterprise id and email address. We don't need to assign any other attributes. --- app/controllers/admin/customers_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/admin/customers_controller.rb b/app/controllers/admin/customers_controller.rb index bb7fca7d09..b69c8b2759 100644 --- a/app/controllers/admin/customers_controller.rb +++ b/app/controllers/admin/customers_controller.rb @@ -37,10 +37,9 @@ module Admin def create @customer = Customer.find_or_new(customer_params[:email], customer_params[:enterprise_id]) - @customer.assign_attributes(customer_params) if user_can_create_customer? - @customer.set_created_manually_flag + @customer.created_manually = true if @customer.save tag_rule_mapping = TagRule.mapping_for(Enterprise.where(id: @customer.enterprise)) render_as_json @customer, tag_rule_mapping: tag_rule_mapping