summaryrefslogtreecommitdiff
path: root/lib/data_entry.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/data_entry.rb')
-rw-r--r--lib/data_entry.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/data_entry.rb b/lib/data_entry.rb
index 9f6e786..4eeb66d 100644
--- a/lib/data_entry.rb
+++ b/lib/data_entry.rb
@@ -1,15 +1,18 @@
module OpenTox
class DataEntry
- #field :feature_id, type: BSON::ObjectId
- #field :compound_id, type: BSON::ObjectId
+ field :feature_id, type: BSON::ObjectId
+ field :compound_id, type: BSON::ObjectId
# Kludge because csv import removes type information
- field :feature_id, type: String
- field :compound_id, type: String
+ #field :feature_id, type: String
+ #field :compound_id, type: String
field :value
field :warnings, type: String
field :unit, type: String
store_in collection: "data_entries"
+ belongs_to :dataset
+ has_one :compound
+ has_one :feature
# preferred method for the insertion of data entries
# @example DataEntry.find_or_create compound,feature,value
@@ -32,5 +35,6 @@ module OpenTox
def self.[](compound,feature)
self.where(:compound_id => compound.id.to_s, :feature_id => feature.id.to_s).distinct(:value).first
end
+
end
end