Skip to content

Instantly share code, notes, and snippets.

@ashleymason
Created January 14, 2019 20:05
Show Gist options
  • Save ashleymason/2f8f15faee06557877eaed3d78c670d0 to your computer and use it in GitHub Desktop.
Save ashleymason/2f8f15faee06557877eaed3d78c670d0 to your computer and use it in GitHub Desktop.
admin-approve all new luxpo campaigns
partner = Partner[:luxpo]
Campaign.joins(:campaign_insertion_order).
where(campaigns: {
partner_id: partner.id,
status: :pending_approval,
}
).
where(campaign_insertion_orders: { source: 'feed_automation'}).
find_each do |c|
c.update(site_approved_at: Time.now)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment