@@ -23,10 +23,6 @@ def generate_csv
2323
2424 attr_reader :partners
2525
26- def headers
27- base_table . keys
28- end
29-
3026 def base_table
3127 table = {
3228 "Agency Name" => -> ( partner ) { partner . name } ,
@@ -51,14 +47,37 @@ def base_table
5147 "Program Zip Code" => -> ( partner ) { partner . profile . program_zip_code }
5248 }
5349
50+ media_information_col ( table )
51+ agency_stability_col ( table )
52+ organizational_capacity_col ( table )
53+ sources_of_funding_col ( table )
54+ area_served_col ( table )
55+ population_served_col ( table )
56+ executive_director_col ( table )
57+ pick_up_person_col ( table )
58+ agency_distribution_information_col ( table )
59+
60+ table [ "Quantity-based Requests" ] = -> ( partner ) { partner . profile . enable_quantity_based_requests } # Columns from the partner_settings partial
61+ table [ "Child-based Requests" ] = -> ( partner ) { partner . profile . enable_child_based_requests }
62+ table [ "Individual Requests" ] = -> ( partner ) { partner . profile . enable_individual_requests }
63+
64+ table [ "Providing Diapers" ] = -> ( partner ) { diaper_statuses [ partner . id ] }
65+ table [ "Providing Period Supplies" ] = -> ( partner ) { period_supplies_statuses [ partner . id ] }
66+
67+ table
68+ end
69+
70+ def media_information_col ( table )
5471 if @partials_to_show . include? "media_information"
5572 table [ "Agency Website" ] = -> ( partner ) { partner . profile . website }
5673 table [ "Facebook" ] = -> ( partner ) { partner . profile . facebook }
5774 table [ "Twitter" ] = -> ( partner ) { partner . profile . twitter }
5875 table [ "Instagram" ] = -> ( partner ) { partner . profile . instagram }
5976 table [ "No Social Media Presence" ] = -> ( partner ) { partner . profile . no_social_media_presence }
6077 end
78+ end
6179
80+ def agency_stability_col ( table )
6281 if @partials_to_show . include? "agency_stability"
6382 table [ "Year Founded" ] = -> ( partner ) { partner . profile . founded }
6483 table [ "Form 990 Filed" ] = -> ( partner ) { partner . profile . form_990 }
@@ -71,24 +90,32 @@ def base_table
7190 table [ "Receive Essentials From Other Sources" ] = -> ( partner ) { partner . profile . receives_essentials_from_other }
7291 table [ "Currently Providing Diapers" ] = -> ( partner ) { partner . profile . currently_provide_diapers }
7392 end
93+ end
7494
95+ def organizational_capacity_col ( table )
7596 if @partials_to_show . include? "organizational_capacity"
7697 table [ "Client Capacity" ] = -> ( partner ) { partner . profile . client_capacity }
7798 table [ "Storage Space" ] = -> ( partner ) { partner . profile . storage_space }
7899 table [ "Storage Space Description" ] = -> ( partner ) { partner . profile . describe_storage_space }
79100 end
101+ end
80102
103+ def sources_of_funding_col ( table )
81104 if @partials_to_show . include? "sources_of_funding"
82105 table [ "Sources Of Funding" ] = -> ( partner ) { partner . profile . sources_of_funding }
83106 table [ "How do you currently obtain diapers?" ] = -> ( partner ) { partner . profile . sources_of_diapers }
84107 table [ "Essentials Budget" ] = -> ( partner ) { partner . profile . essentials_budget }
85108 table [ "Essentials Funding Source" ] = -> ( partner ) { partner . profile . essentials_funding_source }
86109 end
110+ end
87111
112+ def area_served_col ( table )
88113 if @partials_to_show . include? "area_served"
89114 table [ "Area Served" ] = -> ( partner ) { county_list_by_regions [ partner . id ] || "" }
90115 end
116+ end
91117
118+ def population_served_col ( table )
92119 if @partials_to_show . include? "population_served"
93120 table [ "Income Requirement" ] = -> ( partner ) { partner . profile . income_requirement_desc }
94121 table [ "Verify Income" ] = -> ( partner ) { partner . profile . income_verification }
@@ -106,7 +133,9 @@ def base_table
106133 table [ "% Greater than 2 times FPL" ] = -> ( partner ) { partner . profile . greater_2_times_fpl }
107134 table [ "% Poverty Unknown" ] = -> ( partner ) { partner . profile . poverty_unknown }
108135 end
136+ end
109137
138+ def executive_director_col ( table )
110139 if @partials_to_show . include? "executive_director"
111140 table [ "Executive Director Name" ] = -> ( partner ) { partner . profile . executive_director_name }
112141 table [ "Executive Director Phone" ] = -> ( partner ) { partner . profile . executive_director_phone }
@@ -116,27 +145,26 @@ def base_table
116145 table [ "Primary Contact Cell" ] = -> ( partner ) { partner . profile . primary_contact_mobile }
117146 table [ "Primary Contact Email" ] = -> ( partner ) { partner . profile . primary_contact_email }
118147 end
148+ end
119149
150+ def pick_up_person_col ( table )
120151 if @partials_to_show . include? "pick_up_person"
121152 table [ "Pick Up Person Name" ] = -> ( partner ) { partner . profile . pick_up_name }
122153 table [ "Pick Up Person Phone" ] = -> ( partner ) { partner . profile . pick_up_phone }
123154 table [ "Pick Up Person Email" ] = -> ( partner ) { partner . profile . pick_up_email }
124155 end
156+ end
125157
158+ def agency_distribution_information_col ( table )
126159 if @partials_to_show . include? "agency_distribution_information"
127160 table [ "Distribution Times" ] = -> ( partner ) { partner . profile . distribution_times }
128161 table [ "New Client Times" ] = -> ( partner ) { partner . profile . new_client_times }
129162 table [ "More Docs Required" ] = -> ( partner ) { partner . profile . more_docs_required }
130163 end
164+ end
131165
132- table [ "Quantity-based Requests" ] = -> ( partner ) { partner . profile . enable_quantity_based_requests } # Columns from the partner_settings partial
133- table [ "Child-based Requests" ] = -> ( partner ) { partner . profile . enable_child_based_requests }
134- table [ "Individual Requests" ] = -> ( partner ) { partner . profile . enable_individual_requests }
135-
136- table [ "Providing Diapers" ] = -> ( partner ) { diaper_statuses [ partner . id ] }
137- table [ "Providing Period Supplies" ] = -> ( partner ) { period_supplies_statuses [ partner . id ] }
138-
139- table
166+ def headers
167+ base_table . keys
140168 end
141169
142170 def build_row_data ( partner )
0 commit comments