Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8bbfd5ae88
@ -68,19 +68,22 @@ class ImportCsv < ApplicationRecord
|
||||
end
|
||||
|
||||
csv_text = File.read(self.file.path, :encoding => 'UTF-8')
|
||||
@csv = CSV.parse(csv_text, :headers => true, :col_sep => ",")
|
||||
@csv = CSV.parse(csv_text, :headers => true, :col_sep => ";")
|
||||
r = []
|
||||
@csv.each do |row|
|
||||
line = {}
|
||||
self.import_csv_champs.each do |import_csv_champ|
|
||||
if import_csv_champ.header?
|
||||
eval "line['#{import_csv_champ.champ}'] = row[\"#{import_csv_champ.header}\"]"
|
||||
|
||||
elsif import_csv_champ.value?
|
||||
eval "line['#{import_csv_champ.champ}'] = \"#{import_csv_champ.value}\""
|
||||
eval "line['#{import_csv_champ.champ}'] = #{import_csv_champ.value}"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
r << line
|
||||
|
||||
end
|
||||
@ -90,9 +93,6 @@ class ImportCsv < ApplicationRecord
|
||||
|
||||
def load
|
||||
self.table_name.classify.constantize.import_csv(self.charge, self, self.m_odr_id)
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
-if @m_odr
|
||||
%br
|
||||
%br
|
||||
-if false
|
||||
-if @m_odr.id >= 31
|
||||
-if @m_odr.logo_image_file
|
||||
=image_tag "https://"+HOSTNAME+@m_odr.logo_image_file.file.url, :class => "odr_logo", :style => (@m_odr.logo_image_file_width? ? "max-width:#{@m_odr.logo_image_file_width}px;margin:auto;": "")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user