diff options
author | gebele <gebele@in-silico.ch> | 2019-06-18 15:04:55 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2019-06-18 15:04:55 +0000 |
commit | bba7061d7ff2420f4eb2b6f88362edb71bc6bf25 (patch) | |
tree | a06a8451dda7d2aed930a21ffa12c034ac8842f5 /lib | |
parent | 3869670b3acfb4de982f45ea24af940eccac5474 (diff) |
return training dataset from source
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dataset.rb | 2 | ||||
-rw-r--r-- | lib/model.rb | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb index 00685b8..51407ca 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -16,7 +16,7 @@ get "/api/dataset/:id/?" do halt 400, "Dataset with id: #{params[:id]} not found." unless dataset case @accept when "text/csv", "application/csv" - return dataset.to_csv + return File.read dataset.source else bad_request_error "Mime type #{@accept} is not supported." end diff --git a/lib/model.rb b/lib/model.rb index 9bf4f53..b26447d 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -20,6 +20,7 @@ end get "/api/model/:id/?" do model = Model::Validation.find params[:id] halt 400, "Model with id: #{params[:id]} not found." unless model + model["training_dataset"] = model.model.training_dataset.id.to_s return model.to_json end |