diff options
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 |