facebook / facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
208 stars 161 forks source link

Retrieving Campaign edges for an AdAccount doesn't work #80

Closed jamesr2323 closed 4 years ago

jamesr2323 commented 4 years ago

Which SDK version are you using?

v 0.4.0.6

What's the issue?

The example provided on the README for listing campaign names doesn't work. It returns a NoMethodError for #campaigns.

Steps/Sample code to reproduce the issue

I have initialized the SDK using FacebookAds.configure. This appears to have worked, because as seen below, I can retrieve the name of the Ad Account using the ID.

[43] pry(main)> id = 'act_xxxxxxxx'
=> "act_xxxxxxx"
[44] pry(main)> ad_account = FacebookAds::AdAccount.get(id)
=> #<FacebookAds::AdAccount {:id=>"act_xxxxxxxxx"}>
[45] pry(main)> ad_account.name
=> "Training 2"
[46] pry(main)> ad_account.campaigns(fields: 'name').map(&:name)
NoMethodError: undefined method `campaigns' for #<FacebookAds::AdAccount:0x000055bc2463b470>

Expected Results:

#campaigns would return a new object allowing me to iterate through the Campaign edges on the AdAccount.

jamesr2323 commented 4 years ago

I think I tracked down the root issue, which is the fields added in https://github.com/facebook/facebook-ruby-business-sdk/commit/c5fa1fa2f2fa7d38ad35ee7f8360775c1e2dae22, causing the AdAccount object to not properly intialise with all the methods. I have submitted a PR to resolve https://github.com/facebook/facebook-ruby-business-sdk/pull/81.

stale[bot] commented 4 years ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.