From 6378d45274ccaa0a55c1867e522304cf245aa99a Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 5 Aug 2020 14:50:58 +0200 Subject: [PATCH] fix acq.media release CSV export --- app/models/acquired_media_release.rb | 2 +- app/models/concerns/csv_exportable.rb | 3 +++ app/models/location_release.rb | 4 ---- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/models/acquired_media_release.rb b/app/models/acquired_media_release.rb index 0c6d2cf..5593c03 100644 --- a/app/models/acquired_media_release.rb +++ b/app/models/acquired_media_release.rb @@ -18,7 +18,7 @@ class AcquiredMediaRelease < ApplicationRecord class << self def custom_csv_exportable_headers - %i[name file_infos_count] + %i[approved? name file_infos_count owner_info] end end diff --git a/app/models/concerns/csv_exportable.rb b/app/models/concerns/csv_exportable.rb index 4936842..7709d8f 100644 --- a/app/models/concerns/csv_exportable.rb +++ b/app/models/concerns/csv_exportable.rb @@ -28,6 +28,9 @@ module CsvExportable end private + def owner_info + contact_info(name: person_name, address: person_address, phone: person_phone, email: person_email) + end def contact_info(name: nil, address: nil, phone: nil, email: nil) contact_info = '' diff --git a/app/models/location_release.rb b/app/models/location_release.rb index 3340fd5..ea83ddb 100644 --- a/app/models/location_release.rb +++ b/app/models/location_release.rb @@ -71,10 +71,6 @@ class LocationRelease < ApplicationRecord contact_info(name: name, address: address) end - def owner_info - contact_info(name: person_name, address: person_address, phone: person_phone, email: person_email) - end - def amendment_signed_column if amendment_signable? amendment_signed? diff --git a/config/locales/en.yml b/config/locales/en.yml index b8724cb..21c983a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -62,6 +62,7 @@ en: empty: Acquired Media Releases will appear here table_headers: approved: Approved + approved?: Approved file_infos_count: No. Files name: Name notes: Notes diff --git a/config/locales/es.yml b/config/locales/es.yml index 5f71cfc..483a5d8 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -22,6 +22,7 @@ es: signed_at: Date Signed (ES) tags: Tags (ES) owner_info: Owner Info (ES) + approved: Appproved? activerecord: attributes: appearance_release: