From 26b66aac963830bef3f4184f2216673ffe6eb906 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Thu, 5 Apr 2018 16:50:57 +0200 Subject: [PATCH] Improve a method name --- app/lib/pipedrive/deal_adapter.rb | 2 +- app/services/pipedrive_service.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/lib/pipedrive/deal_adapter.rb b/app/lib/pipedrive/deal_adapter.rb index 91a28b39b..a8c4ad826 100644 --- a/app/lib/pipedrive/deal_adapter.rb +++ b/app/lib/pipedrive/deal_adapter.rb @@ -23,7 +23,7 @@ class Pipedrive::DealAdapter Pipedrive::API.put_deal(deal_id, params) end - def self.fetch_waiting_deal_ids(person_id) + def self.get_deals_ids_for_person(person_id) Pipedrive::API.get_deals_for_person(person_id) .map { |datum| datum['id'] } end diff --git a/app/services/pipedrive_service.rb b/app/services/pipedrive_service.rb index 1ff086d67..09fc32779 100644 --- a/app/services/pipedrive_service.rb +++ b/app/services/pipedrive_service.rb @@ -1,12 +1,12 @@ class PipedriveService def self.accept_demande_from_person(person_id, owner_id, stage_id) - person_deals_ids = Pipedrive::DealAdapter.fetch_waiting_deal_ids(person_id) + person_deals_ids = Pipedrive::DealAdapter.get_deals_ids_for_person(person_id) person_deals_ids.each { |deal_id| Pipedrive::DealAdapter.update_deal_owner_and_stage(deal_id, owner_id, stage_id) } Pipedrive::PersonAdapter.update_person_owner(person_id, owner_id) end def self.refuse_demande_from_person(person_id, owner_id) - person_deals_ids = Pipedrive::DealAdapter.fetch_waiting_deal_ids(person_id) + person_deals_ids = Pipedrive::DealAdapter.get_deals_ids_for_person(person_id) person_deals_ids.each { |deal_id| Pipedrive::DealAdapter.refuse_deal(deal_id, owner_id) } Pipedrive::PersonAdapter.update_person_owner(person_id, owner_id) end