The new version of the ar-extensions gem requires that you load the appropriate adapter yourself. On my development side I use mysql, however Heroku uses PostgreSQL.
For example, on my development side I need to do this:
require 'ar-extensions/adapters/mysql'
require 'ar-extensions/import/mysql'
How can I audo-detect which adapter to use?
ActiveRecord::Base.configurations[Rails.env]['adapter']
will give you the name of the adapter in use.
The following code should do what you're after:
db_adapter = ActiveRecord::Base.configurations[Rails.env]['adapter']
require "ar-extensions/adapters/#{db_adapter}"
require "ar-extensions/import/#{db_adapter}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With