summaryrefslogtreecommitdiff
path: root/lib/validation.rb
blob: 94023617af5820f793fd7347501d8f828d05b871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module OpenTox

  module Validation

    # Base validation class
    class Validation
      include OpenTox
      include Mongoid::Document
      include Mongoid::Timestamps
      store_in collection: "validations"
      field :name, type: String
      field :model_id, type: BSON::ObjectId
      field :predictions, type: Hash, default: {}
      field :finished_at, type: Time 

      # Get model
      # @return [OpenTox::Model::Lazar]
      def model
        Model::Lazar.find model_id
      end

    end

  end

end