Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate save() #1136

Merged
merged 6 commits into from
Oct 24, 2022
Merged
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
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