Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Votos < ActiveRecord::Base
- def getConnection(idinst)
- logger.warn "Cambiando establishment db to sagde#{self.idinst.to_i}"
- c = Establishment.establish_connection(
- :adapter => "postgresql",
- :host => ESTABLISHMENT_HOST,
- :username => "carlos",
- :password => "password database",
- :database => "sagde#{idinst.to_i}"
- )
- return c.connection
- end
- def questions(idinst)
- getConnection(idinst).find(aqui la consulta)
- end
- end
Add Comment
Please, Sign In to add comment