class Scenic::Adapters::Postgres::Connection
Decorates an ActiveRecord connection with methods that help determine the connections capabilities.
Every attempt is made to use the versions of these methods defined by Rails where they are available and public before falling back to our own implementations for older Rails versions.
@api private
Public Instance Methods
Source
# File lib/scenic/adapters/postgres/connection.rb, line 41 def postgresql_version if undecorated_connection.respond_to?(:postgresql_version) super else undecorated_connection.send(:postgresql_version) end end
An integer representing the version of Postgres
we’re connected to.
postgresql_version
is public in Rails 5, but protected in earlier versions.
@return [Integer]
Calls superclass method
Source
# File lib/scenic/adapters/postgres/connection.rb, line 31 def supports_concurrent_refreshes? postgresql_version >= 90400 end
True if the connection supports concurrent refreshes of materialized views.
@return [Boolean]
Source
# File lib/scenic/adapters/postgres/connection.rb, line 19 def supports_materialized_views? if undecorated_connection.respond_to?(:supports_materialized_views?) super else postgresql_version >= 90300 end end
True if the connection supports materialized views.
Delegates to the method of the same name if it is already defined on the connection. This is the case for Rails 4.2 or higher.
@return [Boolean]
Calls superclass method
Private Instance Methods
Source
# File lib/scenic/adapters/postgres/connection.rb, line 51 def undecorated_connection __getobj__ end