Sha256: ea202a8f7b7d8656f43c279923afe32b167f15782808cab07847422cb350da38

Contents?: true

Size: 568 Bytes

Versions: 9

Compression:

Stored size: 568 Bytes

Contents

module UsdaNutrientDatabase
  class Footnote < ActiveRecord::Base
    self.table_name = 'usda_footnotes'

    validates :nutrient_databank_number, presence: true,
      uniqueness: { allow_blank: true }
    validates :footnote_number, presence: true
    validates :footnote_type, presence: true
    validates :footnote_text, 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

9 entries across 9 versions & 1 rubygems

Version Path
usda-nutrient-database-1.2.0 lib/usda_nutrient_database/footnote.rb
usda-nutrient-database-1.1.0 lib/usda_nutrient_database/footnote.rb
usda-nutrient-database-1.0.1 lib/usda_nutrient_database/footnote.rb
usda-nutrient-database-1.0.0 lib/usda_nutrient_database/footnote.rb
usda-nutrient-database-0.8.1 lib/usda_nutrient_database/footnote.rb
usda-nutrient-database-0.8.0 lib/usda_nutrient_database/footnote.rb
usda-nutrient-database-0.7.0 lib/usda_nutrient_database/footnote.rb
usda-nutrient-database-0.6.0 lib/usda_nutrient_database/footnote.rb
usda-nutrient-database-0.5.0 lib/usda_nutrient_database/footnote.rb