ruby 网络会议加载
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 网络会议加载相关的知识,希望对你有一定的参考价值。
total_errors = []
BusinessConferenceMeeting.transaction do
index = 0
file_path = '/home/ubuntu/citas.csv'
CSV.foreach(file_path, headers: true, col_sep: ";") do |row|
import_columns = Hash[row.map{|header, value| [header.to_s.downcase.strip, value.to_s]}]
index += 1
participant_profile_display_name = import_columns["participant"]
participant_profile_contact_name = import_columns["participant_contact"]
host_profile_display_name = import_columns["host"]
host_profile_contact_name = import_columns["host_contact"]
participant = BusinessConferenceParticipant.where(profile_display_name: participant_profile_display_name, profile_contact_name: participant_profile_contact_name, business_conference_id: 3983, archived: false)
host = BusinessConferenceParticipant.where(profile_display_name: host_profile_display_name, profile_contact_name: host_profile_contact_name, business_conference_id: 3983, archived: false)
if participant.blank?
puts "Participant in line #{index + 1} not found"
end
if host.blank?
puts "Host in line #{index + 1} not found"
end
next if participant.blank? or host.blank?
start_date = import_columns["date"]
start_date = start_date.to_datetime
start_date = start_date.to_i
meeting, errors = BusinessConferenceMeeting.add_new(3983, host.first.id, participant.first.id, start_date, nil, User.find(4084), 4, true, false)
if errors.present?
total_errors << "#{index + 1} --- #{errors}"
else
meeting.update_columns(location: import_columns["table"])
puts "Line #{index + 1}"
end
end
end
puts total_errors
以上是关于ruby 网络会议加载的主要内容,如果未能解决你的问题,请参考以下文章
ruby 会议报告
ruby BE101会议1家庭作业答案
在 DataTables 表加载 Ruby on Rails 时显示微调器
我要开发网络会议软件
会议室预定终章
Outlook 加载项:获取所选会议的与会者电子邮件地址