Class: Vanity::Adapters::ActiveRecordAdapter::VanityExperiment
- Inherits:
-
VanityRecord
- Object
- ActiveRecord::Base
- VanityRecord
- Vanity::Adapters::ActiveRecordAdapter::VanityExperiment
- Defined in:
- lib/vanity/adapters/active_record_adapter.rb
Overview
Experiment model
Class Method Summary collapse
-
.retrieve(experiment) ⇒ Object
Finds or creates the experiment.
Instance Method Summary collapse
Methods inherited from VanityRecord
Class Method Details
.retrieve(experiment) ⇒ Object
Finds or creates the experiment
99 100 101 |
# File 'lib/vanity/adapters/active_record_adapter.rb', line 99 def self.retrieve(experiment) find_or_create_by_experiment_id(experiment.to_s) end |
Instance Method Details
#increment_conversion(alternative, count = 1) ⇒ Object
103 104 105 106 |
# File 'lib/vanity/adapters/active_record_adapter.rb', line 103 def increment_conversion(alternative, count = 1) record = vanity_conversions.find_or_create_by_alternative(alternative) record.increment!(:conversions, count) end |