lib/slack/smart-bot/commands/general/delete_share.rb in slack-smart-bot-1.14.2 vs lib/slack/smart-bot/commands/general/delete_share.rb in slack-smart-bot-1.15.0
- old
+ new
@@ -7,19 +7,20 @@
channel = Thread.current[:dchannel]
else
channel = Thread.current[:dest]
end
if File.exist?("#{config.path}/shares/#{@channels_name[channel]}.csv") and !@shares.key?(@channels_name[channel])
- t = CSV.table("#{config.path}/shares/#{@channels_name[channel]}.csv", headers: ['share_id', 'user_deleted', 'user_created', 'date', 'time', 'type', 'to_channel', 'condition'])
+ t = CSV.table("#{config.path}/shares/#{@channels_name[channel]}.csv", headers: ['share_id', 'user_team_id_deleted', 'user_deleted', 'user_team_id_created', 'user_created', 'date', 'time', 'type', 'to_channel', 'condition'])
@shares[@channels_name[channel]] = t
end
found = false
message = ''
if @shares[@channels_name[channel]][:share_id].include?(share_id.to_i)
CSV.open("#{config.path}/shares/#{@channels_name[channel]}.csv", "w") do |csv|
@shares[@channels_name[channel]].each do |row|
if row[:share_id].to_i == share_id.to_i
message = row[:condition]
+ row[:user_team_id_deleted] = user.team_id
row[:user_deleted] = user.name
end
csv << row
end
end