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

fixed issue #107 #119

Closed

Conversation

kambayashia
Copy link
Contributor

Issue Type: Bug

Fixes / Relates To: #107

Changes Included:

  • change LineItem#to_params

create

twitter-ads v1.0.0 >> line_item = TwitterAds::LineItem.new(account)
=> #<TwitterAds::LineItem:0x70234623841280>
twitter-ads v1.0.0 >> line_item.automatically_select_bid = true
=> true
twitter-ads v1.0.0 >> line_item.save
=> #<TwitterAds::LineItem:0x70234623841280 id="6c5pd">

twitter-ads v1.0.0 >> line_item.automatically_select_bid = false
=> false
twitter-ads v1.0.0 >> line_item.bid_amount_local_micro = 10000
=> 10000
twitter-ads v1.0.0 >> line_item.save
=> #<TwitterAds::LineItem:0x70234633619900 id="6c5pu">

update

twitter-ads v1.0.0 >> line_item.automatically_select_bid = false
=> false
twitter-ads v1.0.0 >> line_item.bid_amount_local_micro = 10000
=> 10000
twitter-ads v1.0.0 >> line_item.save
=> #<TwitterAds::LineItem:0x70134070607520 id="6bvuj">

twitter-ads v1.0.0 >> line_item.bid_amount_local_micro = nil
=> nil
twitter-ads v1.0.0 >> line_item.automatically_select_bid = true
=> true
twitter-ads v1.0.0 >> line_item.save
=> #<TwitterAds::LineItem:0x70256292750640 id="6bvuj">

Check List:

For more information on check list items, please see the Contributors Guide.

params.delete(:bid_type) if params.has_key?(:automatically_select_bid)

# If set to true, bid_amount_local_micro must be NULL
params.store(:bid_amount_local_micro, nil) if params[:automatically_select_bid] && !self.id.nil?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant self detected.
Line is too long. [102/100]

params = super

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Hash#key? instead of Hash#has_key?.

@kambayashia kambayashia closed this Nov 7, 2016
@kambayashia kambayashia deleted the hotfix/fix-issue-107 branch December 20, 2016 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants