21 lines
809 B
Plaintext
21 lines
809 B
Plaintext
-@csv.each do |row|
|
|
-#if !row[:header_row]
|
|
-if row["Départements d'élection"].to_s == ""
|
|
ALERTE
|
|
- @politique = Politique.new(:fiche_type_id => 1)
|
|
- @politique.fiche_url = row[0]
|
|
- @politique.titre = row[1]
|
|
- @politique.civilite = row[2]
|
|
- @politique.firstname = row[3]
|
|
- @politique.name = row[4]
|
|
- @politique.email = row[5]
|
|
- @politique.circonscription_id = row[7]
|
|
- @politique.politique_departement = PolitiqueDepartement.where(name: row["Départements d'élection"]).first_or_create
|
|
- @politique.depute_group = DeputeGroup.where(name: row["Groupes"]).first_or_create
|
|
-if row["Commissions"].to_s != ""
|
|
-commission = DeputeCommission.where(name: row["Commissions"]).first_or_create
|
|
-@politique.depute_commissions << commission
|
|
=@politique.save
|
|
|
|
=debug @politique
|