Sha256: f7256f164fe73dc30bee565da5d84f5d87d75abdab7de31e0954c09d84d2ef6f
Contents?: true
Size: 722 Bytes
Versions: 15
Compression:
Stored size: 722 Bytes
Contents
module UsdaNutrientDatabase class FoodsNutrient < ActiveRecord::Base self.table_name = 'usda_foods_nutrients' validates :nutrient_databank_number, presence: true, uniqueness: { scope: :nutrient_number, allow_blank: true } validates :nutrient_number, presence: true, uniqueness: { scope: :nutrient_databank_number, allow_blank: true } validates :nutrient_value, presence: true validates :num_data_points, presence: true validates :src_code, presence: true belongs_to :food, class_name: 'UsdaNutrientDatabase::Food', foreign_key: :nutrient_databank_number belongs_to :nutrient, class_name: 'UsdaNutrientDatabase::Nutrient', foreign_key: :nutrient_number end end
Version data entries
15 entries across 15 versions & 1 rubygems