Update P2P campaign creation to properly copy the campaign image urls

This commit is contained in:
Eric Schultz 2018-07-03 15:06:50 -05:00
parent 571c6838d3
commit ec3ca228a8

View file

@ -18,14 +18,14 @@ module CreatePeerToPeerCampaign
campaign = Campaign.create(p2p_params)
# campaign.remote_main_image_url = parent_campaign.main_image_url unless !parent_campaign.main_image rescue AWS::S3::Errors::NoSuchKey
# campaign.remote_background_image_url = parent_campaign.background_image_url unless !parent_campaign.background_image rescue AWS::S3::Errors::NoSuchKey
# campaign.remote_banner_image_url = parent_campaign.background_image_url unless !parent_campaign.background_image rescue AWS::S3::Errors::NoSuchKey
campaign.published = true
campaign.profile = profile
campaign.save
campaign.update_attribute(:main_image, parent_campaign.main_image) unless !parent_campaign.main_image rescue AWS::S3::Errors::NoSuchKey
campaign.update_attribute(:background_image, parent_campaign.background_image) unless !parent_campaign.background_image rescue AWS::S3::Errors::NoSuchKey
campaign.update_attribute(:banner_image, parent_campaign.banner_image) unless !parent_campaign.banner_image rescue AWS::S3::Errors::NoSuchKey
return { errors: campaign.errors.messages }.as_json unless campaign.errors.empty?
gift_option_params = []