From 8e74fbbe98b4ef13c3d7a52352ab0e5ec99b7675 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Fri, 6 Aug 2010 13:27:13 +0200 Subject: prediction caching --- application.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'application.rb') diff --git a/application.rb b/application.rb index 1c94f24..4bf6e94 100644 --- a/application.rb +++ b/application.rb @@ -11,6 +11,15 @@ class Model property :created_at, DateTime end +class Prediction + # cache predictions + include DataMapper::Resource + property :id, Serial + property :compound_uri, String, :length => 255 + property :model_uri, String, :length => 255 + property :yaml, Text, :length => 2**32-1 +end + DataMapper.auto_upgrade! require 'lazar.rb' @@ -51,3 +60,9 @@ delete '/?' do response['Content-Type'] = 'text/plain' "All Models deleted." end + +delete '/prediction?' do + Prediction.auto_migrate! + response['Content-Type'] = 'text/plain' + "All datasets deleted." +end -- cgit v1.2.3