Skip to content

Commit

Permalink
Temporary workaround for twitterdev issue xdevplatform#107
Browse files Browse the repository at this point in the history
xdevplatform#107

This patch of code has been incoprated from
kamabayashia/twitter-ruby-ads-sdk.
  • Loading branch information
esakai committed Dec 8, 2017
1 parent 866657e commit aac7568
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/twitter-ads/campaign/line_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,20 @@ def targeting_criteria(id = nil, opts = {})
id ? TargetingCriteria.load(account, id, opts) : TargetingCriteria.all(account, @id, opts)
end

def to_params
params = super

# If bid_type is set, automatically_select_bid must not be set.
params.delete(:automatically_select_bid) if params.key?(:bid_type)

# If set to true, bid_amount_local_micro must be NULL
params.store(:bid_amount_local_micro, nil) if params[:bid_type].to_s == Enum::BidType::AUTO.to_s && !self.id.nil?

# advertiser_user_id is currently beta-only and causes an error when sent.
params.delete(:advertiser_user_id)

params
end

end
end

0 comments on commit aac7568

Please sign in to comment.