Last active
August 29, 2015 14:07
-
-
Save joseramonc/7488aba4efd35cd7587b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def allCB | |
@corporativoCB = Corporativo.all | |
@clasesActividadCB = ClaseActividad.all | |
@clasificadorCB = ClasificadorSe.all | |
@clasificador_id = -1; | |
@clases_actividad_id =-1; | |
@countryCB = Country.all | |
@stateCB = Array.new# = State.all | |
@municipioCB=Array.new# = Municipio.all | |
@pobladoCB=Array.new #= Poblado.all | |
if [email protected]_facturacion_negocio.direccion.nil? | |
@country_id = @negocio.datos_facturacion_negocio.direccion.country_id | |
@state_id = @negocio.datos_facturacion_negocio.direccion.state_id | |
@municipio_id = @negocio.datos_facturacion_negocio.direccion.municipio_id | |
@poblado_id = @negocio.datos_facturacion_negocio.direccion.poblado_id | |
end | |
if @country_id.nil? | |
@country_id = 139 | |
end | |
@stateCB = Country.find(@country_id).states | |
if @state_id.nil? && @stateCB.count>0 | |
@state_id = @stateCB.first.id | |
end | |
if @stateCB.count > 0 | |
@municipioCB = @stateCB.find(@state_id).municipios | |
end | |
if !@state_id.nil? && @municipio_id.nil? && @municipioCB.count>0 | |
@municipio_id = @municipioCB.first.id | |
end | |
if @municipioCB.count> 0 | |
@pobladoCB = @municipioCB.find(@municipio_id).poblados | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The CB I think is because ComboBox... Trust me, I got the same here but in Java