Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##config/database.yml (add a new section, presence_tools)
- # SQLite version 3.x
- # gem install sqlite3-ruby (not necessary on OS X Leopard)
- development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
- # Warning: The database defined as 'test' will be erased and
- # re-generated from your development database when you run 'rake'.
- # Do not set this db to the same as development or production.
- test:
- adapter: sqlite3
- database: db/test.sqlite3
- timeout: 5000
- production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
- #Configuration to connect to the production Presence PREP (PCO)
- #database
- presence_prep:
- adapter: oracle
- username: prep
- password: prep
- database: 10.0.1.199/xe
- #Configuration to connect to the production ODBC
- #database for future use
- custom_odbc:
- adapter: odbc
- username: prep
- password: prep
- database: 10.0.1.199/xe
- ##app/controller/application.rb
- # Filters added to this controller apply to all controllers in the application.
- # Likewise, all the methods added will be available for all controllers.
- class ApplicationController < ActionController::Base
- helper :all # include all helpers, all the time
- # See ActionController::RequestForgeryProtection for details
- # Uncomment the :secret if you're not using the cookie session store
- protect_from_forgery # :secret => 'fef7e934f0787fc5eb358ba0de0c6b4b'
- require 'yaml'
- require 'soap/wsdlDriver'
- #Provides additional database connections
- before_filter :set_extra_db_connections
- def set_extra_db_connections
- #Connect to the Presence PREP repository and assign those models to this connection
- extra_presence = YAML.load(File.open(File.join(RAILS_ROOT,"config/database.yml"),"r"))["presence_prep"]
- PcoOutboundqueue.establish_connection(extra_presence)
- PcoDonotcalllist.establish_connection(extra_presence)
- PcoLoad.establish_connection(extra_presence)
- PcoOutboundservice.establish_connection(extra_presence)
- #Connect to the secondary ODBC repository and assign those models to this connection
- #Coming soon....
- #extra_odbc = YAML.load(File.open(File.join(RAILS_ROOT,"config/database.yml"),"r"))["presence_prep"]
- #New_Model.establish_connection(extra_odbc)
- end
Add Comment
Please, Sign In to add comment