ruby-geonames icon indicating copy to clipboard operation
ruby-geonames copied to clipboard

Initialization

Open vpopiol opened this issue 11 years ago • 0 comments

Hello,

I love this Gem. The only issue I have is that I can't initialize the configuration in a Rails app because of the way you are storing the config in a Thread.current. I had to monkey patch it to store the config in a global variable. Otherwise, I would have to configure it before each call.

This is how I would change the config method in geonames.rb:

def config
  $config ||= Geonames::Config.new
end

Any thoughts?

Thanks for such a cool Gem!

vpopiol avatar Aug 10 '13 13:08 vpopiol