Class: Mg::Test
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Mg::Test
- Defined in:
- lib/mountain-goat/models/mg/test.rb
Overview
Mg::Test represents something you are ‘a/b testing’
Attributes
- test_type
-
Symbol uniquely identifying this test (for code interaction)
- title
-
Title of the test (E.g. Banner text)
- tally_each_serve
-
Should we count each view by a user as a hit, or just first-serve to that user?
- is_switch
-
Are we implementing a code-switch as opposed to a text substitution
- deleted_at
-
Is this test deleted? (MG Console)
- is_hidden
-
Is this test hidden? (MG Console)
Instance Method Summary collapse
-
#total_reward ⇒ Object
Get total reward of all choices for this test.
-
#total_served ⇒ Object
Get total served of all choices for this test.
Instance Method Details
#total_reward ⇒ Object
Get total reward of all choices for this test
23 24 25 |
# File 'lib/mountain-goat/models/mg/test.rb', line 23 def total_reward self.mg_choices.map { |choice| choice.reward || 0 }.sum end |
#total_served ⇒ Object
Get total served of all choices for this test
28 29 30 |
# File 'lib/mountain-goat/models/mg/test.rb', line 28 def total_served self.mg_choices.map { |choice| choice.served || 0 }.sum end |