6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/fresh_connection/extend/ar_resolver.rb', line 6
def spec(*args)
specification = super
case specification.config[:adapter].to_s
when "mysql", "mysql2"
require 'fresh_connection/extend/adapters/m2_adapter'
__extend_adapter_by_fc(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, M2Adapter)
when "postgresql"
require 'fresh_connection/extend/adapters/pg_adapter'
__extend_adapter_by_fc(::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter, PgAdapter)
else
raise NotImplementedError, "This adapter('#{specification.config[:adapter]}') is not supported. If you specified the mysql or postgres adapter, it's probably a bug in FreshConnection. Please teach me (https://github.com/tsukasaoishi/fresh_connection/issues/new)"
end
specification
end
|