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

9 lines
290 B
Ruby

class Readout < ActiveRecord::Base
belongs_to :measurement, inverse_of: :readouts, required: true
belongs_to :quantity, required: true
belongs_to :unit, required: true
validates :quantity, uniqueness: {scope: [:measurement_id, :unit_id]}
validates :value, numericality: true
end