Skip to content

Commit

Permalink
Deprecate save() (#1136)
Browse files Browse the repository at this point in the history
* Deprecate save method

* Deprecate save method

* Update deprecation message

* Add 'a'

* Reviewer comments
  • Loading branch information
anniel-stripe committed Nov 2, 2022
1 parent f51653e commit 8bb6694
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/stripe/api_operations/save.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def update(id, params = {}, opts = {})
end
end

# The `save` method is DEPRECATED and will be removed in a future major
# version of the library. Use the `update` method on the resource instead.
#
# Creates or updates an API resource.
#
# If the resource doesn't yet have an assigned ID and the resource is one
Expand Down Expand Up @@ -68,6 +71,8 @@ def save(params = {}, opts = {})
resp, opts = execute_resource_request(:post, save_url, values, opts)
initialize_from(resp.data, opts)
end
extend Gem::Deprecate
deprecate :save, :update, 2022, 11

def self.included(base)
# Set `metadata` as additive so that when it's set directly we remember
Expand Down

0 comments on commit 8bb6694

Please sign in to comment.