From bd54e0815a93a2d57f8bbba10aff89574b24fa3b Mon Sep 17 00:00:00 2001 From: Xiao Xie Date: Wed, 23 Feb 2022 15:45:14 +1300 Subject: [PATCH 1/2] Add note field API --- lib/pipedrive.rb | 1 + lib/pipedrive/note_field.rb | 9 +++++++++ spec/lib/pipedrive/note_field_spec.rb | 13 +++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 lib/pipedrive/note_field.rb create mode 100644 spec/lib/pipedrive/note_field_spec.rb diff --git a/lib/pipedrive.rb b/lib/pipedrive.rb index b872e92..604d543 100644 --- a/lib/pipedrive.rb +++ b/lib/pipedrive.rb @@ -92,6 +92,7 @@ def logger # Notes require 'pipedrive/note' +require 'pipedrive/note_field' # Users require 'pipedrive/user' diff --git a/lib/pipedrive/note_field.rb b/lib/pipedrive/note_field.rb new file mode 100644 index 0000000..08672c0 --- /dev/null +++ b/lib/pipedrive/note_field.rb @@ -0,0 +1,9 @@ +module Pipedrive + class NoteField < Base + include ::Pipedrive::Operations::Read + + def entity_name + 'noteFields' + end + end +end diff --git a/spec/lib/pipedrive/note_field_spec.rb b/spec/lib/pipedrive/note_field_spec.rb new file mode 100644 index 0000000..bbdfb7c --- /dev/null +++ b/spec/lib/pipedrive/note_field_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe ::Pipedrive::NoteField do + subject { described_class.new('token') } + + describe '#entity_name' do + subject { super().entity_name } + + it { is_expected.to eq('noteFields') } + end +end From 45f9f7d0b7bfce13210405b99f7d879854f65317 Mon Sep 17 00:00:00 2001 From: Chuan-Zheng Lee Date: Mon, 10 Oct 2022 10:07:49 +1100 Subject: [PATCH 2/2] Add OrganizationRelationship endpoint --- lib/pipedrive.rb | 1 + lib/pipedrive/organization_relationship.rb | 14 ++++++++++++++ .../pipedrive/organization_relationship_spec.rb | 13 +++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 lib/pipedrive/organization_relationship.rb create mode 100644 spec/lib/pipedrive/organization_relationship_spec.rb diff --git a/lib/pipedrive.rb b/lib/pipedrive.rb index 604d543..7c83757 100644 --- a/lib/pipedrive.rb +++ b/lib/pipedrive.rb @@ -57,6 +57,7 @@ def logger # Organizations require 'pipedrive/organization_field' +require 'pipedrive/organization_relationship' require 'pipedrive/organization' # Filters diff --git a/lib/pipedrive/organization_relationship.rb b/lib/pipedrive/organization_relationship.rb new file mode 100644 index 0000000..d264a62 --- /dev/null +++ b/lib/pipedrive/organization_relationship.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Pipedrive + class OrganizationRelationship < Base + include ::Pipedrive::Operations::Read + include ::Pipedrive::Operations::Create + include ::Pipedrive::Operations::Update + include ::Pipedrive::Operations::Delete + + def entity_name + 'organizationRelationships' + end + end +end diff --git a/spec/lib/pipedrive/organization_relationship_spec.rb b/spec/lib/pipedrive/organization_relationship_spec.rb new file mode 100644 index 0000000..843506e --- /dev/null +++ b/spec/lib/pipedrive/organization_relationship_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe ::Pipedrive::OrganizationRelationship do + subject { described_class.new('token') } + + describe '#entity_name' do + subject { super().entity_name } + + it { is_expected.to eq('organizationRelationships') } + end +end