blob: 6aa1dcb0dd85920339ab6ee3629b1be9c1648315 (
plain)
1
2
3
4
5
6
7
|
class TargetAllocation < ApplicationRecord
belongs_to :target
belongs_to :nutrient_profile
validates :percentage, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 100 }
validates :nutrient_profile_id, uniqueness: { scope: :target_id }
end
|