Sha256: 00f783c832681170c4c683b918775c856c94f807cc0dd8aa5709aa557fa3867a
Contents?: true
Size: 594 Bytes
Versions: 4
Compression:
Stored size: 594 Bytes
Contents
module UsdaNutrientDatabase class Nutrient < ActiveRecord::Base self.table_name = 'usda_nutrients' self.primary_key = 'nutrient_number' validates :nutrient_number, presence: true, uniqueness: { allow_blank: true } validates :units, presence: true validates :nutrient_description, presence: true validates :number_decimal_places, presence: true validates :sort_record_order, presence: true, numericality: { allow_blank: true } has_many :foods_nutrients, class_name: 'UsdaNutrientDatabase::FoodsNutrient', dependent: :destroy end end
Version data entries
4 entries across 4 versions & 1 rubygems