Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 0.84 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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