Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom connections #3

Open
jwoertink opened this issue Jul 2, 2015 · 0 comments
Open

Custom connections #3

jwoertink opened this issue Jul 2, 2015 · 0 comments

Comments

@jwoertink
Copy link

It would be awesome to be able to set the abstract_class and establish_connection through an initializer?

Maybe something like

Wordpress.config do |c|
  c.connection = "wordpress_#{Rails.env}"
  c.abstract_class = Wordpress::Base
end

That way, your database.yml could be setup like

development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

wordpress_development:
  adapter: mysql2
  database: wp_blog
  host: localhost
  username: admin
  password: whatever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant