Fixed double flash when not followed by request Added Food#destroy error reporting Simplified prepare_meals with no ingredients Renamed scope on item with subitems: subitems -> with_subitems
11 lines
368 B
Ruby
11 lines
368 B
Ruby
class Readout < QuantityValue
|
|
belongs_to :measurement, foreign_key: 'registry_id', 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
|