Sha256: c36ace1f53243baa00e54cc86d57c03d2a7452e468862bcc5a91502b1e4022f5

Contents?: true

Size: 352 Bytes

Versions: 12

Compression:

Stored size: 352 Bytes

Contents

module UsdaNutrientDatabase
  class FoodGroup < ActiveRecord::Base
    self.table_name = 'usda_food_groups'
    self.primary_key = 'code'

    validates :code, presence: true, uniqueness: { allow_blank: true }
    validates :description, presence: true

    has_many :foods, class_name: 'UsdaNutrientDatabase::Food',
      dependent: :destroy
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
usda-nutrient-database-1.0.0 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.8.1 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.8.0 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.7.0 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.6.0 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.5.0 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.4.0 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.3.0 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.2.0 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.1.2 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.1.1 lib/usda_nutrient_database/food_group.rb
usda-nutrient-database-0.1.0 lib/usda_nutrient_database/food_group.rb