* Trying some models for audience segmentation * AudienceSegment basics * Attach AudienceSegment to DisplayAd * Possibly use a DUS to populate AudienceSegments * Add to display ad form UI * Add to display ad API * Refresh strategy for audience segments * Add user_id to async ads query * Maybe :testing -> :manual, for no-refresh segment * Test & tweak segment refresh * Testing audience_segment#refresh logic * Coverage: testing human_readable * Scope segment refresh to recently active users * Tweak logic for when to refresh * Tweak experience levels to match SettingsHelper * Test for front-end logic * Fix test, hope this helps coverage? * Better test names * One worker for all, many workers for each, perform_bulk * Fix audience segment UI, needs to use id, not enum * cron/schedule should RefreshAll * Singular id in RefreshWorker
9 lines
225 B
Ruby
9 lines
225 B
Ruby
module DataUpdateScripts
|
|
class CreateInitialAudienceSegments
|
|
def run
|
|
AudienceSegment::QUERIES.each_key do |segment_type|
|
|
AudienceSegment.find_or_create_by type_of: segment_type
|
|
end
|
|
end
|
|
end
|
|
end
|