diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-02-17 10:01:06 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-02-17 10:01:06 +0100 |
commit | 76a9e2d17c2130829d5772c9c8d55072ab40ab58 (patch) | |
tree | 736670ea330c651880ff4396e139f0b00e701fbd | |
parent | a787ecc2bff70ee705f09d3ba9b38b24394f5075 (diff) |
migrate when delete_all, dataset prediction fixed
-rw-r--r-- | application.rb | 3 | ||||
-rw-r--r-- | lazar.rb | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/application.rb b/application.rb index d3787a9..db5b41e 100644 --- a/application.rb +++ b/application.rb @@ -46,6 +46,7 @@ end delete '/?' do - Model.all.each { |d| d.destroy! } + #Model.all.each { |d| d.destroy! } + Model.auto_migrate! "All Models deleted." end @@ -3,9 +3,11 @@ class Lazar < Model attr_accessor :dataset, :predictions def classify(compound_uri) - - @dataset = OpenTox::Dataset.new - @predictions = {} + + unless @dataset + @dataset = OpenTox::Dataset.new + @predictions = {} + end lazar = YAML.load yaml compound = OpenTox::Compound.new(:uri => compound_uri) compound_matches = compound.match lazar[:features] @@ -50,6 +52,7 @@ class Lazar < Model :features => compound_matches } } } end + end def database_activity?(compound_uri) |