diff --git a/templates/ruby/lib/facebook_ads/api_request.rb b/templates/ruby/lib/facebook_ads/api_request.rb index 370f01c7..82afef41 100644 --- a/templates/ruby/lib/facebook_ads/api_request.rb +++ b/templates/ruby/lib/facebook_ads/api_request.rb @@ -97,14 +97,14 @@ def batch_body # For Batch API def params_without_files params.reject do |_,v| - v.is_a?(UploadIO) + v.is_a?(Faraday::UploadIO) end end # For Batch API def files params.select do |_,v| - v.is_a?(UploadIO) + v.is_a?(Faraday::UploadIO) end end end diff --git a/templates/ruby/lib/facebook_ads/field_types/upload_file.rb b/templates/ruby/lib/facebook_ads/field_types/upload_file.rb index 378644de..540c3a76 100644 --- a/templates/ruby/lib/facebook_ads/field_types/upload_file.rb +++ b/templates/ruby/lib/facebook_ads/field_types/upload_file.rb @@ -77,9 +77,9 @@ def serialize(value) if category == :video FacebookAds::VideoIO.new(value, content_type) else - ::UploadIO.new(value, content_type) + Faraday::UploadIO.new(value, content_type) end - when UploadIO + when Faraday::UploadIO value # when etc etc TODO Rails/Sinatra Upload else @@ -98,7 +98,7 @@ def content_type_for(ext) end def self.acceptable?(value) - [File, Tempfile, UploadIO].each do |type| + [File, Tempfile, Faraday::UploadIO].each do |type| return true if value.is_a?(type) end diff --git a/templates/ruby/lib/facebook_ads/videos/video_io.rb b/templates/ruby/lib/facebook_ads/videos/video_io.rb index 41755bbe..ebcb6de0 100644 --- a/templates/ruby/lib/facebook_ads/videos/video_io.rb +++ b/templates/ruby/lib/facebook_ads/videos/video_io.rb @@ -7,7 +7,7 @@ require 'faraday/multipart' module FacebookAds - class VideoIO < ::UploadIO + class VideoIO < Faraday::UploadIO def is_video? true end