Permalink
Browse files

Improving serialization of alternatives, for example for people who w…

…ant to use :symbols as alternatives. This is not particularly recommended yet.
  • Loading branch information...
1 parent f8a07d0 commit 3af05112a141d3aa36d4befa6aa4a06f72afb242 @patio11 patio11 committed Aug 18, 2009
Showing with 3 additions and 6 deletions.
  1. +1 −4 lib/abingo/alternative.rb
  2. +2 −2 lib/abingo/statistics.rb
@@ -2,10 +2,7 @@ class Abingo::Alternative < ActiveRecord::Base
include Abingo::ConversionRate
belongs_to :experiment
-
- def pretty_content
- YAML::load content
- end
+ serialize :content
def self.calculate_lookup(test_name, alternative_name)
Digest::MD5.hexdigest(Abingo.salt + test_name + alternative_name.to_s)
@@ -69,9 +69,9 @@ def describe_result_in_words
alts = alternatives - [best_alternative]
worst_alternative = alts.first
- words += "The best alternative you have is: [#{best_alternative.pretty_content}], which had "
+ words += "The best alternative you have is: [#{best_alternative.content}], which had "
words += "#{best_alternative.conversions} conversions from #{best_alternative.participants} participants "
- words += "(#{best_alternative.pretty_conversion_rate}). The other alternative was [#{worst_alternative.pretty_content}], "
+ words += "(#{best_alternative.pretty_conversion_rate}). The other alternative was [#{worst_alternative.content}], "
words += "which had #{worst_alternative.conversions} conversions from #{worst_alternative.participants} participants "
words += "(#{worst_alternative.pretty_conversion_rate}). "

0 comments on commit 3af0511

Please sign in to comment.