Sha256: 4b571a97538aa245a60abd313673f2c5f7b36859d72948a19fbef38c3f330dac

Contents?: true

Size: 402 Bytes

Versions: 10

Compression:

Stored size: 402 Bytes

Contents

class FoodGroup < ActiveRecord::Base
  self.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

10 entries across 10 versions & 1 rubygems

Version Path
earth-0.11.20 lib/earth/diet/food_group.rb
earth-0.11.19 lib/earth/diet/food_group.rb
earth-0.11.18 lib/earth/diet/food_group.rb
earth-0.11.17 lib/earth/diet/food_group.rb
earth-0.11.16 lib/earth/diet/food_group.rb
earth-0.11.15 lib/earth/diet/food_group.rb
earth-0.11.14 lib/earth/diet/food_group.rb
earth-0.11.13 lib/earth/diet/food_group.rb
earth-0.11.12 lib/earth/diet/food_group.rb
earth-0.11.11 lib/earth/diet/food_group.rb