Skip to content

Commit

Permalink
Add Food.by_food_group_code scope
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbeedle committed Aug 1, 2015
1 parent 4462d66 commit f18f96d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/usda_nutrient_database/food.rb
Expand Up @@ -26,5 +26,8 @@ class Food < ActiveRecord::Base
joins(:nutrients)
.where(nutrients: { nutrient_number: nutrient_number })
}
scope :by_food_group_code, ->(food_group_code) {
where(food_group_code: food_group_code)
}
end
end

0 comments on commit f18f96d

Please sign in to comment.