I am trying to concatenate the ":" sign with value that is inside a variable but when trying to concatenate it shows me the following error: bad URI(is not URI?): :208
This is the code I am trying to concatenate in the ApplicationController:
def set_database
if usuario_signed_in?
empresa = ':'+(current_usuario.empresa_id)
ActiveRecord::Base.establish_connection(empresa)
end
With the previous code does not work, but replacing the variable as follows does not show the error:
if usuario_signed_in?
empresa = :'208'
ActiveRecord::Base.establish_connection(empresa)
end