Sha256: bff4fd233cda5492b2bfbde26bee451e54fe8502c7739cccd9e4ee99b0106318

Contents?: true

Size: 1.01 KB

Versions: 471

Compression:

Stored size: 1.01 KB

Contents

module Caboose
  class RetargetingConfig < ActiveRecord::Base
    self.table_name = "retargeting_configs"

    belongs_to :site
    attr_accessible :id,
      :site_id,
      :google_conversion_id,      
      :google_labels_function,
      :fb_pixel_id,
      :fb_vars_function
      #:fb_access_token,
      #:fb_access_token_expires
    
    def google_labels(request, page)
      return [] if self.google_labels_function.nil? || self.google_labels_function.strip.length == 0      
      return [self.google_labels_function] if self.google_labels_function.starts_with?('_')        
      arr = eval(self.google_labels_function)      
      return [] if arr.nil?
      return [arr] if arr is_a? String
      return arr        
    end
    
    def fb_vars(request, page)
      return [] if self.fb_vars_function.nil? || self.fb_vars_function.strip.length == 0      
      arr = eval(self.fb_vars_function)      
      return [] if arr.nil?
      return [arr] if arr is_a? String
      return arr        
    end
    
  end  
end

Version data entries

471 entries across 471 versions & 1 rubygems

Version Path
caboose-cms-0.9.229 app/models/caboose/retargeting_config.rb
caboose-cms-1.0.2 app/models/caboose/retargeting_config.rb
caboose-cms-1.0.1 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.228 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.227 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.226 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.225 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.224 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.223 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.222 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.221 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.220 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.219 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.218 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.217 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.216 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.215 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.214 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.213 app/models/caboose/retargeting_config.rb
caboose-cms-0.9.212 app/models/caboose/retargeting_config.rb