TMP commit

This commit is contained in:
Bilal
2020-07-09 20:17:48 +02:00
parent 5ed930108d
commit bb8e5c9b73
3 changed files with 17 additions and 3 deletions

View File

@@ -12,14 +12,19 @@ module CsvExportable
APPEARANCE_HEADERS = %i[name contact_info].freeze + COMMON_HEADERS
APPEARANCE_VALUES = %w[name contact_info].freeze + COMMON_VALUES
LOCATION_HEADERS = %i[name address].freeze + COMMON_HEADERS
LOCATION_VALUES = %w[name address].freeze + COMMON_VALUES
HEADERS = {
acquired_media_release: ACQUIRED_MEDIA_HEADERS,
appearance_release: APPEARANCE_HEADERS
appearance_release: APPEARANCE_HEADERS,
location_release: LOCATION_HEADERS
}.freeze
VALUES = {
acquired_media_release: ACQUIRED_MEDIA_VALUES,
appearance_release: APPEARANCE_VALUES
appearance_release: APPEARANCE_VALUES,
location_release: LOCATION_VALUES
}.freeze
included do
@@ -35,9 +40,11 @@ module CsvExportable
end
def to_csv_row
VALUES[self.class.name.underscore.to_sym].map do |function|
v = VALUES[self.class.name.underscore.to_sym].map do |function|
send(function)
end
puts v
v
end
private