1
0

Fixed association

This commit is contained in:
cryptogopher 2020-05-21 00:23:38 +02:00
parent ad2f647960
commit 976271d6b4

View File

@ -1,6 +1,6 @@
class Readout < QuantityValue
belongs_to :measurement, foreign_key: 'registry_id', inverse_of: :readouts,
polymorphic: true, required: true
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]}