Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).

This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).

## [2.1.1] - 2025-08-06

### Changed
- Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
Comment on lines +10 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Insert blank line after the sub-heading to satisfy MD022 / MD032

markdownlint still flags the “### Changed” heading because it isn’t followed by a blank line before the list. Add one empty line to keep the changelog style consistent and lint-clean.

 ### Changed
+
 - Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Changed
- Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
### Changed
- Deal, Organization, Person, Pipeline, Product, Stage and User now support API **v2**.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

10-10: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


11-11: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

🤖 Prompt for AI Agents
In CHANGELOG.md around lines 10 to 11, the sub-heading "### Changed" is not
followed by a blank line, causing markdownlint errors MD022 and MD032. Insert a
single blank line immediately after the "### Changed" heading to separate it
from the list below, ensuring consistent style and passing the lint check.


## [2.1.0] - 2025-08-06

### Added
Expand All @@ -20,6 +25,7 @@ This change log follows the conventions of [keepachangelog.com](http://keepachan

- Fix bugs introduced with version 2 where the base URL for v1 was broken.
- Add GitHub Actions workflow

## [2.0.0] - 2025-04-11

- **BREAKING change**: Minimum ruby version updated to 2.7.
Expand Down
6 changes: 5 additions & 1 deletion lib/pipedrive/resources/deal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ class Deal < Resource
has_many :products, class_name: "Product"
has_many :participants, class_name: "Participant"

# fields are only available in v1
# https://developers.pipedrive.com/docs/api/v1/DealFields#getDealFields
use_fields_version :v1

def self.supports_v2_api?
false
true
end
end
end
8 changes: 8 additions & 0 deletions lib/pipedrive/resources/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@ class Organization < Resource
has_many :activities, class_name: "Activity"
has_many :deals, class_name: "Deal"
has_many :persons, class_name: "Person"

# fields are only available in v1
# https://developers.pipedrive.com/docs/api/v1/OrganizationFields#getOrganizationFields
use_fields_version :v1

def self.supports_v2_api?
true
end
end
end
8 changes: 8 additions & 0 deletions lib/pipedrive/resources/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@ class Person < Resource

has_many :deals, class_name: "Deal"
has_many :activities, class_name: "Activity"

# fields are only available in v1
# https://developers.pipedrive.com/docs/api/v1/PersonFields#getPersonFields
use_fields_version :v1

def self.supports_v2_api?
true
end
end
end
6 changes: 5 additions & 1 deletion lib/pipedrive/resources/pipeline.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# frozen_string_literal: true

module Pipedrive
class Pipeline < Resource; end
class Pipeline < Resource
def self.supports_v2_api?
true
end
end
end
6 changes: 5 additions & 1 deletion lib/pipedrive/resources/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ module Pipedrive
class Product < Resource
include Fields

# fields are only available in v1
# https://developers.pipedrive.com/docs/api/v1/ProductFields#getProductFields
use_fields_version :v1

def self.supports_v2_api?
false
true
end
end
end
6 changes: 5 additions & 1 deletion lib/pipedrive/resources/stage.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# frozen_string_literal: true

module Pipedrive
class Stage < Resource; end
class Stage < Resource
def self.supports_v2_api?
true
end
end
end
4 changes: 4 additions & 0 deletions lib/pipedrive/resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ def self.find(term, search_by_email)

items.map { |d| new(d) }
end

def self.supports_v2_api?
true
end
end
end
2 changes: 1 addition & 1 deletion lib/pipedrive/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Pipedrive
VERSION = "2.1.0"
VERSION = "2.1.1"
end
10 changes: 0 additions & 10 deletions spec/lib/pipedrive/deal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,4 @@
expect(subject.delete_product(product_attachment_id)).to be_truthy
end
end

describe "V2 api version" do
before do
Pipedrive.use_v2_api!
end

it "continues to use V1 endpoint" do
expect(described_class.api_version).to eq(:v1)
end
end
end