Closed wjessop closed 13 years ago
This one issue with trying the load database_configuration is the source of the biggest incompatibilities of Foreigner with a a number of gems. The real fix is being able to hook into the ActiveRecord initialization stage and insert code, something like an after_establish_connection :load_foreigner ... or something to that effect. There's a Rails issue tracked with this. I've also thought about monkey-patching ActiveRecord.
This might be a 1.9 issue too. I have a 1.9 branch setup for the app I'm using this with, though I don't remember if the on_load / config is nil issue shows up. I won't be working on the 1.9 stuff anytime soon, though.
FWIW I got it working fine with https://github.com/matthuhiggins/foreigner, so it seems like its something specific to this fork that is causing the issue.
This fork seems to have a fix: https://github.com/theaboutbox/foreigner/commit/062955abe913f9dd0f268988c282773315a0bc79
Thanks edwintorok, I'll get another release out.
@edwintorok: thanks for pointing out the commit. https://github.com/hosh/foreigner/tree/v0.7.1 and pushed to gemcutter.
Using Rails 3.0.3 and the latest gem version of foreigner I get this error when rails tries to start up:
foreigner.rb:29 is:
If I remove foreigner from the Gemfile and load up the console the config method is available just fine: