mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-29 20:25:09 -04:00
This commit introduces a new partial to display nutritional data from the Australian Food Composition Database. Key changes: - Adds a database index to the `public_food_key` on the `crops` table. - Establishes a `has_one` relationship between `Crop` and `AustralianFoodClassificationData`. - Creates a `_nutritional_data.html.haml` partial to display a summary of key nutritional information. - Renders the partial on the `show` pages for both crops and harvests.
9 lines
265 B
Ruby
9 lines
265 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AustralianFoodClassificationData < ApplicationRecord
|
|
belongs_to :crop,
|
|
foreign_key: :public_food_key,
|
|
primary_key: :public_food_key,
|
|
inverse_of: :australian_food_classification_data
|
|
end
|