File: base.rb

package info (click to toggle)
ruby-combustion 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 332 kB
  • sloc: ruby: 628; makefile: 9; sh: 6
file content (26 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require "active_support/core_ext/module/delegation"

class Combustion::Databases::Base
  def initialize(configuration)
    @configuration = configuration
  end

  def reset
    drop
    create

    establish_connection Rails.env.to_sym
  end

  private

  attr_reader :configuration

  delegate :establish_connection, :connection, :to => :base

  def base
    ActiveRecord::Base
  end
end