Guest User

Untitled

a guest
Jan 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class Votos < ActiveRecord::Base
  2.  
  3. def getConnection(idinst)
  4. logger.warn "Cambiando establishment db to sagde#{self.idinst.to_i}"
  5. c = Establishment.establish_connection(
  6. :adapter => "postgresql",
  7. :host => ESTABLISHMENT_HOST,
  8. :username => "carlos",
  9. :password => "password database",
  10. :database => "sagde#{idinst.to_i}"
  11. )
  12. return c.connection
  13. end
  14.  
  15. def questions(idinst)
  16. getConnection(idinst).find(aqui la consulta)
  17.  
  18. end
  19.  
  20. end
Add Comment
Please, Sign In to add comment