Sha256: 023090ad17f3a67e129bbda1234acd6dcc94b118ca6a7949a49c9e7ce4426575

Contents?: true

Size: 342 Bytes

Versions: 2

Compression:

Stored size: 342 Bytes

Contents

module Daidan
  module Db
    class Connection
      def self.setup(config_path = File.join(Dir.pwd, 'config', 'database.yml'))
        @db ||= begin
          db_config = YAML.load_file(config_path)['db']
          Sequel.connect(db_config).tap do |db|
            Sequel::Model.db = db
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
daidan-0.2.0 lib/daidan/db/connection.rb
daidan-0.1.0 lib/daidan/db/connection.rb