Sha256: eb06f611fcb3b8c454893b005a0d0fe6aab7651c53e73ec0284b1b99c039c210
Contents?: true
Size: 594 Bytes
Versions: 894
Compression:
Stored size: 594 Bytes
Contents
# Class for A-B testing variants. A variant is a set of changes # to the same element on a page. For example, a variant can be used # to change the button text, or images displayed, or even more # complicated behavior class Caboose::AbVariant < ActiveRecord::Base self.table_name = "ab_variants" has_many :ab_options, :order => 'id', :dependent => :destroy has_many :ab_values, :dependent => :destroy attr_accessible :name, :analytics_name def random_option return nil if self.ab_options.nil? || self.ab_options.count == 0 return self.ab_options.sample end end
Version data entries
894 entries across 894 versions & 1 rubygems