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/threshold.rb
2020-06-25 03:56:49 +02:00

9 lines
351 B
Ruby

class Threshold < QuantityValue
# Need to specify polymorphic association so :registry_type gets written (see
# QuantityValue for explanation why it's needed)
belongs_to :target, inverse_of: :thresholds, polymorphic: true, required: true,
foreign_key: 'registry_id', foreign_type: 'registry_type'
validates :value, numericality: true
end