Module: BrighterPlanet::Diet::Data

Defined in:
lib/diet/data.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/diet/data.rb', line 4

def self.included(base)
  base.data_miner do
    schema do
      string   'diet_class_id'
      float    'proximity'
      float    'conventionality'
      integer  'size'
      float    'intensity'
      float    'red_meat_share'
      float    'poultry_share'
      float    'fish_share'
      float    'eggs_share'
      float    'nuts_share'
      float    'dairy_share'
      float    'cereals_and_grains_share'
      float    'fruit_share'
      float    'vegetables_share'
      float    'oils_and_sugars_share'
      date     'start_date'
      date     'end_date'
    end

    process "pull in related orphans" do
      FoodGroup.run_data_miner!
    end
    
    process :run_data_miner_on_belongs_to_associations
  end
end