module Sequel::ActiveRecordConnection::Postgres

Public Instance Methods

synchronize(*) { |conn| ... } click to toggle source
Calls superclass method
# File lib/sequel/extensions/activerecord_connection/postgres.rb, line 6
def synchronize(*)
  super do |conn|
    conn.extend(ConnectionMethods)
    conn.instance_variable_set(:@db, self)

    Utils.add_prepared_statements_cache(conn)

    yield conn
  end
end
transaction(opts = OPTS) click to toggle source

Reject unsupported Postgres-specific transaction options.

Calls superclass method
# File lib/sequel/extensions/activerecord_connection/postgres.rb, line 18
def transaction(opts = OPTS)
  %i[deferrable read_only synchronous].each do |key|
    fail Error, "#{key.inspect} transaction option is currently not supported" if opts.key?(key)
  end

  super
rescue => e
  activerecord_connection.clear_cache! if e.class.name == "ActiveRecord::PreparedStatementCacheExpired" && !in_transaction?
  raise
end