Class: FoodGroup

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/earth/diet/food_group.rb

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Object



9
10
11
# File 'lib/earth/diet/food_group.rb', line 9

def [](name)
  find_by_name name.to_s
end

.namesObject



5
6
7
# File 'lib/earth/diet/food_group.rb', line 5

def names
  connection.select_values arel_table.project(:name).to_sql
end