I am currently using the facebook-ruby-business-sdk to manage ads on Facebook.
I have written a method to update a FacebookAds::AdSet
object.
# Fetch the adset
adset = FacebookAds::AdSet.get(source_adset_id, session)
# Set the new name
adset.name = 'Test name'
# Save the Adset
adset.save
That works and sets the name, but if i try to set a nested property like so:
adset = FacebookAds::AdSet.get(source_adset_id, session)
# Set the new minimum age
adset.targeting.age_min = 20
# this is the adset's new min age (should be 20)
p adset.age_min
#=> 18
# Save the Adset
adset.save
When i set the adset.targeting.age_min
the value is never set, this goes for any nested value that i try to set.
Am i setting this value the wrong way? Is there any other way to approach this?