Sha256: 719fee6c2dad6b0c179bca87bf750fb061f47f6dd8bdf5b563c196e9d1f6bddf

Contents?: true

Size: 425 Bytes

Versions: 5

Compression:

Stored size: 425 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 # ?

  warn_unless_size 10
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
earth-0.12.4 lib/earth/diet/food_group.rb
earth-0.12.3 lib/earth/diet/food_group.rb
earth-0.12.2 lib/earth/diet/food_group.rb
earth-0.12.1 lib/earth/diet/food_group.rb
earth-0.12.0 lib/earth/diet/food_group.rb