<commit_before>require 'zuck/facebook/ad_creative'

module Zuck
  class AdGroup < RawFbObject

    # Known keys as per
    # [fb docs](https://developers.facebook.com/docs/reference/ads-api/adgroup/v2.2)
    known_keys :id,
               :account_id,
               :conversion_specs,
               :adset_id,
               :created_time,
               :failed_delivery_checks,
               :name,
               :tracking_specs,
               :updated_time,
               :status
               # app must be whitelisted to use view_tags
               # :view_tags

    parent_object :ad_campaign
    list_path     :ads
    connections   :ad_creatives

    def self.create(graph, data, ad_set)
      path = ad_set.ad_account.path
      data[:adset_id] = ad_set.id
      super(graph, data, ad_set, path)
    end

    def status
      data[:adgroup_status] || data[:status]
    end

  end
end<commit_msg>Adds campaign_id back to AdGroup (but now it represents the old CampaignGroup)<commit_after>require 'zuck/facebook/ad_creative'

module Zuck
  class AdGroup < RawFbObject

    # Known keys as per
    # [fb docs](https://developers.facebook.com/docs/reference/ads-api/adgroup/v2.2)
    known_keys :id,
               :account_id,
               :conversion_specs,
               :adset_id,
               :campaign_id,
               :created_time,
               :failed_delivery_checks,
               :name,
               :tracking_specs,
               :updated_time,
               :status
               # app must be whitelisted to use view_tags
               # :view_tags

    parent_object :ad_campaign
    list_path     :ads
    connections   :ad_creatives

    def self.create(graph, data, ad_set)
      path = ad_set.ad_account.path
      data[:adset_id] = ad_set.id
      super(graph, data, ad_set, path)
    end

    def status
      data[:adgroup_status] || data[:status]
    end

  end
end
{'fraction_non_alphanumeric': 0.08237747653806048, 'fraction_numerical': 0.0020855057351407717, 'mean_word_length': 1.813782991202346, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3601586', 'n_tokens_mistral': 607, 'n_tokens_neox': 582, 'n_words': 127}