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
2021-05-06 21:52:35 +02:00

13 lines
422 B
Ruby

class Readout < QuantityValue
DOMAIN = "measurement"
# Need to specify polymorphic association so :registry_type gets written (see
# QuantityValue for explanation why it's needed)
belongs_to :measurement, inverse_of: :readouts, polymorphic: true, required: true,
foreign_key: 'registry_id', foreign_type: 'registry_type'
validates :value, numericality: true
delegate :completed_at, to: :measurement
end