TMP commit
This commit is contained in:
@@ -21,9 +21,10 @@ class GenerateContractsZipJob < ApplicationJob
|
|||||||
zipfile.add(attachment, File.join("#{dir}/", attachment))
|
zipfile.add(attachment, File.join("#{dir}/", attachment))
|
||||||
end
|
end
|
||||||
|
|
||||||
csv_file = generate_csv releases
|
if Object.const_get(@release_type).include?(CsvExportable)
|
||||||
puts ">>>>> GENERATED ====="
|
csv_file = generate_csv releases
|
||||||
zipfile.get_output_stream("#{@folder_name}.csv") { |f| f.puts(csv_file) }
|
zipfile.get_output_stream("#{@folder_name}.csv") { |f| f.puts(csv_file) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@download.file.attach(io: File.open(zipfile_name), filename: "#{@folder_name}.zip")
|
@download.file.attach(io: File.open(zipfile_name), filename: "#{@folder_name}.zip")
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ module CsvExportable
|
|||||||
included do
|
included do
|
||||||
class << self
|
class << self
|
||||||
def csv_headers
|
def csv_headers
|
||||||
puts "HEADERS ===="
|
|
||||||
plural_class_name = self.name.underscore.pluralize
|
plural_class_name = self.name.underscore.pluralize
|
||||||
headers = HEADERS[self.name.underscore.to_sym]
|
headers = HEADERS[self.name.underscore.to_sym]
|
||||||
|
|
||||||
@@ -36,12 +35,9 @@ module CsvExportable
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_csv_row
|
def to_csv_row
|
||||||
puts "==== = 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)
|
send(function)
|
||||||
end
|
end
|
||||||
puts v
|
|
||||||
v
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class LocationRelease < ApplicationRecord
|
|||||||
include Syncable
|
include Syncable
|
||||||
include Taggable
|
include Taggable
|
||||||
include PersonName
|
include PersonName
|
||||||
|
include CsvExportable
|
||||||
|
|
||||||
composed_of :address,
|
composed_of :address,
|
||||||
mapping: [
|
mapping: [
|
||||||
|
|||||||
Reference in New Issue
Block a user