Class: Hanami::Providers::DB::SQLAdapter
- Inherits:
-
Adapter
- Object
- Adapter
- Hanami::Providers::DB::SQLAdapter
show all
- Defined in:
- lib/hanami/providers/db/sql_adapter.rb
Overview
Instance Method Summary
collapse
Methods inherited from Adapter
#gateway_cache_keys, #initialize, #plugin, #plugins, #skip_defaults
Instance Method Details
#clear ⇒ Object
93
94
95
96
|
# File 'lib/hanami/providers/db/sql_adapter.rb', line 93
def clear
config.extensions = nil
super
end
|
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
40
41
42
43
44
45
|
# File 'lib/hanami/providers/db/sql_adapter.rb', line 40
def configure_for_database(database_url)
return if skip_defaults?
configure_plugins
configure_extensions(database_url)
end
|
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/hanami/providers/db/sql_adapter.rb', line 26
def configure_from_adapter(other_adapter)
super
return if skip_defaults?
return unless other_adapter.is_a?(self.class)
extensions.concat(other_adapter.extensions).uniq! unless skip_defaults?(:extensions)
end
|
#extension(*extensions) ⇒ Object
15
16
17
|
# File 'lib/hanami/providers/db/sql_adapter.rb', line 15
def extension(*extensions)
self.extensions.concat(extensions).uniq!
end
|
#extensions ⇒ Object
21
22
23
|
# File 'lib/hanami/providers/db/sql_adapter.rb', line 21
def extensions
config.extensions ||= []
end
|
#gateway_options ⇒ Object
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
87
88
89
|
# File 'lib/hanami/providers/db/sql_adapter.rb', line 87
def gateway_options
{extensions: extensions}
end
|