Permalink
Browse files

/tests/:id/reset.json

  • Loading branch information...
1 parent 7103097 commit f1903aba6a92fac508f45c52e78334c9aad560d6 @winton committed Nov 9, 2010
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/a_b/controller/api.rb
View
@@ -258,6 +258,22 @@
end
end
+ post '/tests/:id/reset.json' do
+ content_type :json
+ @test = ABTest.find params[:id]
+ if @test && allow?(@test)
+ @test.variants.each do |variant|
+ variant.update_attribute(:data, nil)
+ end
+ @test.to_json(
+ :include => symbolize(params[:include]),
+ :only => symbolize(params[:only])
+ )
+ else
+ false.to_json
+ end
+ end
+
post '/users.json' do
content_type :json
if allow_admin?

0 comments on commit f1903ab

Please sign in to comment.