Permalink
Browse files

Merge pull request #84 from zawaideh/rails3

Fix same deprecation warning on Rails3 branch
  • Loading branch information...
2 parents a37411f + eb513e7 commit 4a1385954cb962a3376e1d5ed024dc65962e040b @assaf assaf committed Nov 27, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/vanity/frameworks/rails.rb
@@ -180,10 +180,10 @@ module Helpers
def ab_test(name, &block)
if Vanity.playground.using_js?
@_vanity_experiments ||= {}
- @_vanity_experiments[name] ||= Vanity.playground.experiment(name).choose
+ @_vanity_experiments[name] ||= Vanity.playground.experiment(name.to_sym).choose
value = @_vanity_experiments[name].value
else
- value = Vanity.playground.experiment(name).choose.value
+ value = Vanity.playground.experiment(name.to_sym).choose.value
end
if block
@@ -246,7 +246,7 @@ def index
end
def chooses
- exp = Vanity.playground.experiment(params[:e])
+ exp = Vanity.playground.experiment(params[:e].to_sym)
exp.chooses(exp.alternatives[params[:a].to_i].value)
render :file=>Vanity.template("_experiment"), :locals=>{:experiment=>exp}
end
@@ -256,7 +256,7 @@ def add_participant
render :status => 404, :nothing => true
return
end
- exp = Vanity.playground.experiment(params[:e])
+ exp = Vanity.playground.experiment(params[:e].to_sym)
exp.chooses(exp.alternatives[params[:a].to_i].value)
render :status => 200, :nothing => true
end

0 comments on commit 4a13859

Please sign in to comment.