Class | Zuzenean
In: | app/models/zuzenean.rb
Parent: | Object

Clase para los codigos de departamentos de Zuzenean, para poder reenviarles comentarios que deberían ser tratados como consultas.

### Methods

select_options subsite_name

### Constants

SUBSITES | = | [{:por => 1, :name_es => "ej-gv (antiguo)"}, {:por => 2, :name_es => "Euskadi.net"}, {:por => 4, :name_es => "prestige.ej-gv"}, {:por => 5, :name_es => "Euskara (antiguo)"}, {:por => 6, :name_es => "Cultura (antiguo)"}, {:por => 7, :name_es => "Gizaetxe (antiguo)"}, {:por => 8, :name_es => "Transportes (antiguo)"}, {:por => 9, :name_es => "ej-gv.DAP"}, {:por => 10, :name_es => "Portal de Vivienda (antiguo)"}, {:por => 11, :name_es => "Portal de Asuntos Sociales"}, {:por => 12, :name_es => "Juslan (antiguo)"}, {:por => 13, :name_es => "Gaztebehatokia"}, {:por => 14, :name_es => "Lana"}, {:por => 15, :name_es => "Ogasuna (antiguo)"}, {:por => 16, :name_es => "Lehendakari (antiguo)"}, {:por => 17, :name_es => "Industria, Comercio y Turismo (antiguo)"}, {:por => 18, :name_es => "KirolEskola"}, {:por => 19, :name_es => "Vivienda.Euskadi.net"}, {:por => 20, :name_es => "Transporte.Euskadi.net"}, {:por => 21, :name_es => "Interior.Euskadi.net"}, {:por => 22, :name_es => "Educacion.Euskadi.net"}, {:por => 23, :name_es => "Industria.Euskadi.net"}, {:por => 24, :name_es => "Justicia.Euskadi.net"}, {:por => 25, :name_es => "Cultura.Euskadi.net"}, {:por => 26, :name_es => "Vicepresidencia.Euskadi.net"}, {:por => 27, :name_es => "Lehendakaritza.Euskadi.net"}, {:por => 28, :name_es => "Lurralde.Euskadi.net"}, {:por => 29, :name_es => "Nasdap.Euskadi.net"}, {:por => 30, :name_es => "Hacienda.Euskadi.net"}, {:por => 31, :name_es => "Sanidad.Euskadi.net"}, {:por => 32, :name_es => "EJ-GV Webprincipal"}, {:por => 33, :name_es => "Lehendakari.Euskadi.net"}, {:por => 34, :name_es => "Gazteaukera"}, {:por => 35, :name_es => "Euskara.Euskadi.net"}, {:por => 36, :name_es => "IVAP"}, {:por => 37, :name_es => "Meteorologia"}, {:por => 38, :name_es => "AVPD"}, {:por => 39, :name_es => "Izenpe"}, {:por => 40, :name_es => "Turismo"}, {:por => 45, :name_es => "Basques"}, {:por => 65, :name_es => "Sopelana.Euskadi.net"}]

### Public Class methods

select_options()

Departamentos en formato para elegir en un select

[Source]

        # File app/models/zuzenean.rb, line 47
    47:     def self.select_options
    48:       SUBSITES.collect {|subsite| [subsite[:name_es], subsite[:por]]}
    49:     end

subsite_name(subsite_id)

Devuelve el nombre del departamento a partir del código

[Source]

        # File app/models/zuzenean.rb, line 52
    52:     def self.subsite_name(subsite_id)
    53:       index = SUBSITES.collect {|subsite| subsite.values}.flatten.index(subsite_id)
    54:       if index.nil?
    55:         subsite_id
    56:       else
    57:         SUBSITES[index/2][:name_es]
    58:       end
    59:     end

[Validate]