I\'m using active_delegate for multiple connection in Rails. Here I\'m using mysql as master_database for some models,and postgresql for some other models.
Problem i
I tried ur Sample,still getting error!!
superclass mismatch for class MysqlAdapter
I think ,the problem is with my database.yml file .Please check this file
database_mysql:
adapter: mysql
database: project
host: localhost
username: root
password: root
port: 3306
development:
adapter: postgresql
database: codex
host: localhost
username: postgres
password: root
port: 5432
test:
adapter: postgresql
database: codex
host: localhost
username: postgres
password: root
port: 5432
production:
adapter: postgresql
database: codex
host: localhost
username: postgres
password: root
port: 5432
i start the mongrel in developemnet mode only.
here is my model superclass
$config = YAML.load_file(File.join(File.dirname(__FILE__),
'../../config/database.yml'))
class MasterDatabase < ActiveRecord::Base
self.abstract_class = true
establish_connection $config['database_mysql']
end
Please correct me..