Skip to content

Commit

Permalink
Add support for metadata in update Admin API
Browse files Browse the repository at this point in the history
  • Loading branch information
const-cloudinary committed Jul 14, 2022
1 parent 1ffc7f5 commit ec8f8f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/cloudinary/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def self.update(public_id, options={})
:custom_coordinates => Cloudinary::Utils.encode_double_array(options[:custom_coordinates]),
:detection => options[:detection],
:face_coordinates => Cloudinary::Utils.encode_double_array(options[:face_coordinates]),
:metadata => Cloudinary::Utils.encode_context(options[:metadata]),
:moderation_status => options[:moderation_status],
:notification_url => options[:notification_url],
:quality_override => options[:quality_override],
Expand Down
5 changes: 5 additions & 0 deletions spec/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,11 @@
Cloudinary::Api.update("public_id", {:auto_tagging => 0.5})
end

it "should support updating metadata" do
expect(RestClient::Request).to receive(:execute).with(deep_hash_value([:payload, :metadata] => "key=value"))
Cloudinary::Api.update("public_id", { :metadata => { :key => :value } })
end

it "should support quality_override" do
['auto:advanced', 'auto:best', '80:420', 'none'].each do |q|
expected = {[:payload, :quality_override] => q}
Expand Down

0 comments on commit ec8f8f0

Please sign in to comment.