lib/fish0.rb in fish0-0.0.6 vs lib/fish0.rb in fish0-0.0.7
- old
+ new
@@ -15,10 +15,10 @@
module Fish0
class << self
def mongo_reader
Mongo::Logger.logger = mongo_config['logger'] || Rails.logger
- Mongo::Client.new(mongo_config[:hosts], mongo_config[:params])
+ @mongo_reader ||= Mongo::Client.new(mongo_config[:hosts], mongo_config[:params])
end
def mongo_config
if File.file?(File.expand_path('../config/mongo.yml', __FILE__))
config = Rails.application.config_for(:mongo)