Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update active_record_adapter for rails 3.2

  • Loading branch information...
commit 479802d0b89cbb8dc8893a3599153f28a2ee9a17 1 parent a899463
Doug Cole dougcole authored

Showing 1 changed file with 7 additions and 6 deletions. Show diff stats Hide diff stats

  1. +7 6 lib/vanity/adapters/active_record_adapter.rb
13 lib/vanity/adapters/active_record_adapter.rb
@@ -12,16 +12,17 @@ def active_record_connection(spec)
12 12 class ActiveRecordAdapter < AbstractAdapter
13 13 # Base model, stores connection and defines schema
14 14 class VanityRecord < ActiveRecord::Base
  15 + self.abstract_class = true
15 16 end
16 17
17 18 # Schema model
18 19 class VanitySchema < VanityRecord
19   - set_table_name :vanity_schema
  20 + self.table_name = :vanity_schema
20 21 end
21 22
22 23 # Metric model
23 24 class VanityMetric < VanityRecord
24   - set_table_name :vanity_metrics
  25 + self.table_name = :vanity_metrics
25 26 has_many :vanity_metric_values
26 27
27 28 def self.retrieve(metric)
@@ -31,13 +32,13 @@ def self.retrieve(metric)
31 32
32 33 # Metric value
33 34 class VanityMetricValue < VanityRecord
34   - set_table_name :vanity_metric_values
  35 + self.table_name = :vanity_metric_values
35 36 belongs_to :vanity_metric
36 37 end
37 38
38 39 # Experiment model
39 40 class VanityExperiment < VanityRecord
40   - set_table_name :vanity_experiments
  41 + self.table_name = :vanity_experiments
41 42 has_many :vanity_conversions, :dependent => :destroy
42 43
43 44 # Finds or creates the experiment
@@ -53,13 +54,13 @@ def increment_conversion(alternative, count = 1)
53 54
54 55 # Conversion model
55 56 class VanityConversion < VanityRecord
56   - set_table_name :vanity_conversions
  57 + self.table_name = :vanity_conversions
57 58 belongs_to :vanity_experiment
58 59 end
59 60
60 61 # Participant model
61 62 class VanityParticipant < VanityRecord
62   - set_table_name :vanity_participants
  63 + self.table_name = :vanity_participants
63 64
64 65 # Finds the participant by experiment and identity. If
65 66 # create is true then it will create the participant

0 comments on commit 479802d

Please sign in to comment.
Something went wrong with that request. Please try again.