From bb8e5c9b7350cca8cc6bc0d639ba90a509aa266c Mon Sep 17 00:00:00 2001 From: Bilal Date: Thu, 9 Jul 2020 20:17:48 +0200 Subject: [PATCH] TMP commit --- app/models/concerns/csv_exportable.rb | 13 ++++++++++--- config/locales/en.yml | 1 + config/locales/es.yml | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/csv_exportable.rb b/app/models/concerns/csv_exportable.rb index df2ac33..734e230 100644 --- a/app/models/concerns/csv_exportable.rb +++ b/app/models/concerns/csv_exportable.rb @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 235da08..9a75c3b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -744,6 +744,7 @@ en: search: Search empty: Location Releases will appear here table_headers: + name: Name address: Address notes: Notes signed_at: Date Signed diff --git a/config/locales/es.yml b/config/locales/es.yml index f707cbd..2c03263 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -302,6 +302,12 @@ es: form: photos: dropzone_label: Tap to take a photo of the Property (optional) (ES) + index: + table_headers: + address: Address (ES) + notes: Notes (ES) + tags: Tags (ES) + signed_at: Date Signed (ES) material_releases: form: photos: