Skip to content
Snippets Groups Projects
Commit 92b23bc3 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

wip

parent 99327fb3
No related branches found
No related tags found
No related merge requests found
......@@ -27,9 +27,9 @@ class University::Organization::Import < ApplicationRecord
after_save :parse
def lines
@lines ||= csv.rows
csv.count
rescue
[]
'NA'
end
def to_s
......@@ -39,11 +39,11 @@ class University::Organization::Import < ApplicationRecord
protected
def parse
byebug
lines.each do |line|
csv.each do |line|
byebug
end
end
handle_asynchronously :parse, queue: 'default'
def csv
@csv ||= CSV.parse file.blob.download, headers: true
......
......@@ -11,7 +11,7 @@
<% @imports.each do |import| %>
<tr>
<td><%= link_to import, [:admin, import] %></td>
<td><%= import.lines.count %></td>
<td><%= import.lines %></td>
</tr>
<% end %>
</tbody>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment