Guest User

Untitled

a guest
May 6th, 2012
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. module Pge
  2. module Base
  3. module RepositorioDigital
  4. class BaseConexao < ::ActiveRecord::Base
  5. if RUBY_PLATFORM =~ /java/
  6. require 'rubygems'
  7. gem 'activerecord-jdbcpostgresql-adapter'
  8. require 'jdbc_adapter'
  9. end
  10.  
  11. self.abstract_class = true
  12. self.configurations[RAILS_ENV]['adapter'] = "postgresql"
  13. self.configurations[RAILS_ENV]['host'] = "host"
  14. self.configurations[RAILS_ENV]['username'] = "user"
  15. self.configurations[RAILS_ENV]['password'] = "password"
  16. self.configurations[RAILS_ENV]['database'] = "db_name"
  17. if RAILS_ENV = 'test' then self.configurations[RAILS_ENV]['database'] = 'db_name_test' end
  18. self.configurations[RAILS_ENV]['schema_search_path'] = "public"
  19. establish_connection
  20. end
  21. end
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment