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

View File

@@ -10,6 +10,7 @@ class MaterialRelease < ApplicationRecord
include Syncable
include Taggable
include PersonName
include CsvExportable
composed_of :person_address,
class_name: "Address",

View File

@@ -11,6 +11,7 @@ class MedicalRelease < ApplicationRecord
include SecondGuardianPhotoable
include GuardianName
include SecondGuardianName
include CsvExportable
NUMBER_OF_CUSTOM_FIELDS = 15

View File

@@ -780,6 +780,7 @@ en:
search: Search
empty: Material Releases will appear here
table_headers:
name: Name
notes: Notes
signed_at: Date Signed
tags: Tags
@@ -802,6 +803,8 @@ en:
empty: Medical releases will appear here
table_headers:
approved: Approved
name: Person name
contact_info: Contact info
notes: Notes
signed_at: Date Signed
tags: Tags

View File

@@ -312,12 +312,23 @@ es:
form:
photos:
dropzone_label: Tap to take a photo of Licensed Material (optional) (ES)
index:
table_headers:
name: Name (ES)
notes: Notes (ES)
tags: Tags (ES)
signed_at: Date Signed (ES)
medical_releases:
custom_validation_errors:
question_answer_is_required: answer is required (ES)
index:
table_headers:
approved: Approved (ES)
name: Person name (ES)
contact_info: Contact info (ES)
notes: Notes (ES)
tags: Tags (ES)
signed_at: Date Signed (ES)
medical_release:
actions:
review: Review (ES)