Top Level Namespace
Defined Under Namespace
Modules: GitRoom, NodeCached Classes: BinaryFile, Chunk, Integer, Log, Node, Object
Instance Method Summary collapse
Instance Method Details
#connect ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gitroom/connect.rb', line 9 def connect require 'yaml' require 'active_record' require 'redis' env = ENV['ENVIRONMENT'] || 'development' ar_connection = YAML.load_file('config/database.yml')[env] ActiveRecord::Base.establish_connection ar_connection red_connection = YAML.load_file('config/redis.yml')[env] Object.redis_connection = Redis.new red_connection end |