diff --git a/app/controllers/api/v1/customers_controller.rb b/app/controllers/api/v1/customers_controller.rb index 70bc7936e9..772ed1bb92 100644 --- a/app/controllers/api/v1/customers_controller.rb +++ b/app/controllers/api/v1/customers_controller.rb @@ -31,7 +31,6 @@ module Api authorize! :update, Enterprise.find(customer_params[:enterprise_id]) customer = Customer.find_or_new(customer_params[:email], customer_params[:enterprise_id]) customer.assign_attributes(customer_params) - customer.set_created_manually_flag if customer.save render json: Api::V1::CustomerSerializer.new(customer), status: :created diff --git a/app/models/customer.rb b/app/models/customer.rb index 8e65246265..effeae83c4 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -54,13 +54,6 @@ class Customer < ApplicationRecord "#{first_name} #{last_name}".strip end - def set_created_manually_flag - self.created_manually = true - return unless persisted? - - update_attribute(:created_manually, true) - end - private def downcase_email diff --git a/spec/requests/api/v1/customers_spec.rb b/spec/requests/api/v1/customers_spec.rb index 542d10f9b8..2f12c59e4c 100644 --- a/spec/requests/api/v1/customers_spec.rb +++ b/spec/requests/api/v1/customers_spec.rb @@ -190,6 +190,9 @@ describe "Customers", type: :request do allow_charges: false, terms_and_conditions_accepted_at: nil, ) + + customer = Customer.find(json_response[:data][:attributes][:id]) + expect(customer.created_manually).to eq true end end