diff options
-rw-r--r-- | application.rb | 4 | ||||
-rw-r--r-- | model.rb | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/application.rb b/application.rb index ecb4b7e..30458bc 100644 --- a/application.rb +++ b/application.rb @@ -140,8 +140,8 @@ post '/models' do # create a new model rescue => e error "Dataset creation failed with #{e.message}" end - @dataset.token_id = session[:token_id] if session[:token_id] - @dataset.save + token_id = session[:token_id] if session[:token_id] + @dataset.save(token_id) if @dataset.compounds.size < 10 error "Too few compounds to create a prediction model. Did you provide compounds in SMILES format and classification activities as described in the #{link_to "instructions", "/excel_format"}? As a rule of thumb you will need at least 100 training compounds for nongeneric datasets. A lower number could be sufficient for congeneric datasets." end @@ -38,9 +38,11 @@ class ToxCreateModel property :root_mean_squared_error, Float property :mean_absolute_error, Float - property :token_id, String, :length => 255 property :web_uri, String, :length => 255 + attr_accessor :token_id + @token_id = nil + after :save, :check_policy =begin |