Sha256: ffd93f9983302fc6152052ad585d8e513566aa4fdf74a5b6f335104457584248

Contents?: true

Size: 397 Bytes

Versions: 19

Compression:

Stored size: 397 Bytes

Contents

class FoodGroup < ActiveRecord::Base
  set_primary_key :name

  class << self
    def names
      connection.select_values arel_table.project(:name).to_sql
    end
    
    def [](name)
      find_by_name name.to_s
    end
  end
  
  col :name
  col :intensity, :type => :float
  col :intensity_units
  col :energy, :type => :float
  col :energy_units
  col :suggested_imperial_measurement # ?
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
earth-0.11.10 lib/earth/diet/food_group.rb
earth-0.11.9 lib/earth/diet/food_group.rb
earth-0.11.8 lib/earth/diet/food_group.rb
earth-0.11.7 lib/earth/diet/food_group.rb
earth-0.11.6 lib/earth/diet/food_group.rb
earth-0.11.5 lib/earth/diet/food_group.rb
earth-0.11.4 lib/earth/diet/food_group.rb
earth-0.11.3 lib/earth/diet/food_group.rb
earth-0.11.2 lib/earth/diet/food_group.rb
earth-0.11.1 lib/earth/diet/food_group.rb
earth-0.11.0 lib/earth/diet/food_group.rb
earth-0.7.0 lib/earth/diet/food_group.rb
earth-0.6.6 lib/earth/diet/food_group.rb
earth-0.6.5 lib/earth/diet/food_group.rb
earth-0.6.4 lib/earth/diet/food_group.rb
earth-0.6.3 lib/earth/diet/food_group.rb
earth-0.6.2 lib/earth/diet/food_group.rb
earth-0.6.1 lib/earth/diet/food_group.rb
earth-0.6.0 lib/earth/diet/food_group.rb