Commit c1ad98a89b8981976d58bb72e548f7d584b3134e
1 parent
244da7de
Exists in
master
and in
5 other branches
correction_siorg_instition_creation: Using PublicInstitution instead of Institut…
…ion on SIORG mass update Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
1 changed file
with
2 additions
and
3 deletions
Show diff stats
lib/institution_helper.rb
... | ... | @@ -16,10 +16,10 @@ module InstitutionHelper |
16 | 16 | units = json["unidades"] |
17 | 17 | |
18 | 18 | units.each do |unit| |
19 | - institution = Institution.where(:name=>unit["nome"]) | |
19 | + institution = PublicInstitution.where(:name=>unit["nome"]) | |
20 | 20 | |
21 | 21 | institution = if institution.count == 0 |
22 | - Institution::new | |
22 | + PublicInstitution::new | |
23 | 23 | else |
24 | 24 | institution.first |
25 | 25 | end |
... | ... | @@ -68,7 +68,6 @@ module InstitutionHelper |
68 | 68 | institution.sub_juridical_nature = self.retrieve_code(unit,"codigoSubNaturezaJuridica") |
69 | 69 | institution.normalization_level = unit["nivelNormatizacao"] |
70 | 70 | institution.version = unit["versaoConsulta"] |
71 | - institution.type = "PublicInstitution" | |
72 | 71 | institution.governmental_power = GovernmentalPower.where(:name=>self.retrieve_code(unit,"codigoPoder")).first |
73 | 72 | institution.governmental_sphere = GovernmentalSphere.where(:name=>self.retrieve_code(unit,"codigoEsfera")).first |
74 | 73 | institution | ... | ... |