Sha256: e46aa10194853c828c13ecfaeb7b8ad7386c658e0aea3c42aae470d157521603

Contents?: true

Size: 752 Bytes

Versions: 14

Compression:

Stored size: 752 Bytes

Contents

# == Schema Information
#
# Table name: conductor_raw_experiments
#
#  id               :integer         not null, primary key
#  identity_id      :string(255)
#  group_name       :string(255)
#  option_name      :string(255)
#  conversion_value :decimal(8, 2)
#  created_at       :datetime
#  updated_at       :datetime
#

class Conductor::Experiment::Raw < ActiveRecord::Base
  set_table_name "conductor_raw_experiments"

  validates_presence_of :group_name, :alternative
  named_scope :since, lambda { |a_date| { :conditions =>  ['created_at >= ?',a_date] }}

  def created_date
    self.created_at.strftime('%Y-%m-%d')
  end
  
  def self.purge(days_old=30)
    Conductor::Experiment::Raw.delete_all("created_at <= #{days_old.days.ago}")
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
conductor-0.8.3 lib/conductor/rails/models/raw.rb
conductor-0.8.1 lib/conductor/experiment/raw.rb
conductor-0.7.2 lib/conductor/experiment/raw.rb
conductor-0.7.1 lib/conductor/experiment/raw.rb
conductor-0.7.0 lib/conductor/experiment/raw.rb
conductor-0.6.5 lib/conductor/experiment/raw.rb
conductor-0.6.4 lib/conductor/experiment/raw.rb
conductor-0.6.3 lib/conductor/experiment/raw.rb
conductor-0.5.15 lib/conductor/experiment/raw.rb
conductor-0.5.14 lib/conductor/experiment/raw.rb
conductor-0.5.13 lib/conductor/experiment/raw.rb
conductor-0.5.12 lib/conductor/experiment/raw.rb
conductor-0.5.11 lib/conductor/experiment/raw.rb
conductor-0.5.10 lib/conductor/experiment/raw.rb