TMP commit

This commit is contained in:
Bilal
2020-07-09 20:34:37 +02:00
parent bb8e5c9b73
commit 2020761649
5 changed files with 29 additions and 5 deletions

View File

@@ -15,16 +15,26 @@ module CsvExportable
LOCATION_HEADERS = %i[name address].freeze + COMMON_HEADERS
LOCATION_VALUES = %w[name address].freeze + COMMON_VALUES
MATERIAL_HEADERS = %i[name].freeze + COMMON_HEADERS
MATERIAL_VALUES = %w[name].freeze + COMMON_VALUES
MEDICAL_HEADERS = %i[approved name contact_info].freeze + COMMON_HEADERS
MEDICAL_VALUES = %w[approved? name contact_info].freeze + COMMON_VALUES
HEADERS = {
acquired_media_release: ACQUIRED_MEDIA_HEADERS,
appearance_release: APPEARANCE_HEADERS,
location_release: LOCATION_HEADERS
location_release: LOCATION_HEADERS,
material_release: MATERIAL_HEADERS,
medical_release: MEDICAL_HEADERS
}.freeze
VALUES = {
acquired_media_release: ACQUIRED_MEDIA_VALUES,
appearance_release: APPEARANCE_VALUES,
location_release: LOCATION_VALUES
location_release: LOCATION_VALUES,
material_release: MATERIAL_VALUES,
medical_release: MEDICAL_VALUES
}.freeze
included do
@@ -40,11 +50,9 @@ module CsvExportable
end
def to_csv_row
v = VALUES[self.class.name.underscore.to_sym].map do |function|
VALUES[self.class.name.underscore.to_sym].map do |function|
send(function)
end
puts v
v
end
private