- what's better? database constraints or model validation?
- no easy answer -- it depends on your problem
- try to remember:
- database constraints prevent bad data from being written
- model validations allow for limitless specificity and quick pivots
| 1. Purchase a Realtor zip campaign (be sure to use a profile that has videos, like John Doe in Durham, NC) | |
| 2. Once the campaign is purchased, you should see the TV cross sell on the receipt page. | |
| 3. Click on the Watch my commercial CTA, and ensure you are able to complete the purchase of the TV Campaign. |
| There are 4 criteria for getting the interstitial to display in QA: | |
| 1. Partner has TV enabled | |
| 2. User has not purchased a TV campaign (drafts are fine) | |
| 3. Interstitial has not been show in past week / more than 5 times (Clear cookies/use incognito) | |
| 4. Current Agent is present | |
| That last one is usually the issue when the interstitial is not displaying. The easiest way is to start the funnel | |
| while signed in and search for the profile you want. Once selected, go back to the My Campaigns page and |
| partner = Partner[:luxpo] | |
| partner.extra_data[:default_layouts][:retargeting] = {anx_web: 'luxpo_retargeting_web', facebook: 'luxpo_retargeting_fb'} | |
| partner.save | |
| pas = PartnerAutomationSetting.find_by(partner_id: partner.id) | |
| pf = Partner::Feed.where(partner: partner, type: 'Partner::ListingFeed').first |
| Workers::PartnerData::PartnerFeedSequenceRunner.work( | |
| partners: partner.code, | |
| force_sync: true, | |
| production_only: false, | |
| do_not_queue: true, | |
| limit: 100, | |
| type: 'Partner::ListingFeed' | |
| ) | |
| Workers::PartnerData::PartnerFeedSequenceRunner.work( |
| 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| |
| partner = Partner[:luxpo]; | |
| partner.extra_data[:default_layouts][:retargeting] = {anx_web: 'luxpo_retargeting_web', facebook: 'luxpo_retargeting_fb'}; | |
| partner.save; | |
| pas = PartnerAutomationSetting.find_by(partner_id: partner.id); | |
| unless pas.present? | |
| pas = PartnerAutomationSetting.create( | |
| automation_type: 'retargeting', | |
| send_email: false, | |
| launch_date: 1.year.ago, |
| # What is Imagemagick? | |
| # open-source software for altering image files | |
| # developed in 1987 by John Cristy for DuPont (older than Ruby!) | |
| # originally developed to convert 24-bit images (16 million color) to | |
| # 8-bit images (256-color), so they could be displayed on most screens | |
| # copyright released in 1990 to ImageMagick Studio LLC, which is the organization | |
| # that still maintains it today. | |
| # https://github.com/rmagick/rmagick |