Class: Smooth::AR::Adapter

Inherits:
Object show all
Defined in:
lib/smooth/active_record/adapter.rb

Class Method Summary collapse

Class Method Details

.configureObject



5
6
# File 'lib/smooth/active_record/adapter.rb', line 5

def configure
end

.connectionObject



14
15
16
# File 'lib/smooth/active_record/adapter.rb', line 14

def connection
  ActiveRecord::Base.connection
end

.establish_connectionObject



18
19
20
# File 'lib/smooth/active_record/adapter.rb', line 18

def establish_connection
  @connection = ActiveRecord::Base.establish_connection(Smooth.config.active_record)
end

.in_use?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'lib/smooth/active_record/adapter.rb', line 8

def in_use?
  connection.in_use?
rescue ActiveRecord::ConnectionNotEstablished
  false
end