1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/app/models/readout.rb
2020-05-21 00:23:38 +02:00

11 lines
399 B
Ruby

class Readout < QuantityValue
belongs_to :measurement, foreign_key: 'registry_id', foreign_type: 'registry_type',
inverse_of: :readouts, polymorphic: true, required: true
# Uniqueness NOT validated here, see Value for explanation
#validates :quantity, uniqueness: {scope: [:measurement_id, :unit_id]}
validates :value, numericality: true
delegate :completed_at, to: :measurement
end