Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## config/database.yml [plain_text]
- development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
- ...
- # do this for each of your environments (if you want)
- firebird_development:
- adapter: firebird
- database: firebird_development
- host: localhost
- username: rails
- password: rails
- ## app/models/firebird/base.rb
- class Firebird::Base < ActiveRecord::Base
- set_table_name :firebird_bases
- establish_connection "firebird_#{RAILS_ENV}".intern
- def self.inherited(subclass)
- subclass.send :set_table_name, undecorated_table_name(subclass.name.split(/::/).last)
- end
- end
- ## app/models/firebird/widget.rb
- class Firebird::Widget < Firebird::Base
- # table name is set automatically to "widgets", or you can set
- # it explicitly with:
- # set_table_name 'firebird_widgets'
- end
Add Comment
Please, Sign In to add comment