module TweekCatalogue

Constants

VERSION

Public Class Methods

connect_mongodb!(mongo_config, environment) click to toggle source

def self.included(base)

base.extend(ClassMethods)

end

# File lib/tweek_catalogue.rb, line 28
def self.connect_mongodb!(mongo_config, environment)
  MongoMapper.setup(mongo_config, environment.to_s, {pool_size: find_pool_size(mongo_config, environment)})
end
find_pool_size(mongo_config, environment) click to toggle source
# File lib/tweek_catalogue.rb, line 32
def self.find_pool_size(mongo_config, environment)
  (mongo_config[environment.to_s]['pool_size'].presence || 5).to_i
end