Skip to content

Commit

Permalink
Merge pull request assaf#84 from zawaideh/rails3
Browse files Browse the repository at this point in the history
Fix same deprecation warning on Rails3 branch
  • Loading branch information
assaf committed Nov 27, 2011
2 parents a37411f + eb513e7 commit 4a13859
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/vanity/frameworks/rails.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4a13859

Please sign in to comment.