summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-02-17 10:01:06 +0100
committerMartin Gütlein <martin.guetlein@gmail.com>2010-02-17 10:01:06 +0100
commit76a9e2d17c2130829d5772c9c8d55072ab40ab58 (patch)
tree736670ea330c651880ff4396e139f0b00e701fbd
parenta787ecc2bff70ee705f09d3ba9b38b24394f5075 (diff)
migrate when delete_all, dataset prediction fixed
-rw-r--r--application.rb3
-rw-r--r--lazar.rb9
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
diff --git a/lazar.rb b/lazar.rb
index 4c10c04..9014d3b 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -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)