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

import

parent 2c56c253
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@ class University::Person::Alumnus::Import < ApplicationRecord
def parse
csv.each do |row|
row['program'] = '23279cab-8bc1-4c75-bcd8-1fccaa03ad55' #TMP local fix
# row['program'] = '23279cab-8bc1-4c75-bcd8-1fccaa03ad55' #TMP local fix
program = university.education_programs
.find_by(id: row['program'])
next if program.nil?
......@@ -59,19 +59,18 @@ class University::Person::Alumnus::Import < ApplicationRecord
# TODO all fields
# gender
# birth
# phonepro
# phoneperso
# phone_professional
# phone_personal
# address
# zipcode
# city
# country
# status
person.is_alumnus = true
person.url = url
person.slug = person.to_s.parameterize.dasherize
person.twitter ||= row['socialtwitter']
person.linkedin ||= row['sociallinkedin']
person.biography ||= row['status']
person.twitter ||= row['social_twitter']
person.linkedin ||= row['social_linkedin']
person.biography ||= row['biography']
person.phone ||= row['mobile']
byebug unless person.valid?
person.save
......
......@@ -6,7 +6,7 @@
<% content_for :action_bar_left do %>
<%= link_to t('import'),
admin_university_person_alumnus_imports_path,
new_admin_university_person_alumnus_import_path,
class: button_classes if can? :manage, University::Person::Alumnus::Import %>
<% end %>
......
......@@ -58,11 +58,11 @@
<td>https://www.stephanedupond.fr</td>
</tr>
<tr>
<th>phonepro</th>
<th>phone_professional</th>
<td>+33 1 01 01 01 01</td>
</tr>
<tr>
<th>phoneperso</th>
<th>phone_personal</th>
<td>+33 1 01 01 01 01</td>
</tr>
<tr>
......@@ -86,15 +86,15 @@
<td>FR</td>
</tr>
<tr>
<th>status</th>
<th>biography</th>
<td>Product Designer</td>
</tr>
<tr>
<th>socialtwitter</th>
<th>social_twitter</th>
<td>stephanedupond</td>
</tr>
<tr>
<th>sociallinkedin</th>
<th>social_linkedin</th>
<td>https://www.linkedin.com/in/stephanedupond</td>
</tr>
</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