Sha256: 453eaf2edec222bd37846add192e1d8f87c09553581a3890520a41cf021214fb

Contents?: true

Size: 873 Bytes

Versions: 1

Compression:

Stored size: 873 Bytes

Contents

module Fx
  module Adapters
    class Postgres
      # 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
      class Connection < SimpleDelegator
        # https://www.postgresql.org/docs/9.6/sql-dropfunction.html
        # https://www.postgresql.org/docs/10/sql-dropfunction.html
        def support_drop_function_without_args
          pg_connection = undecorated_connection.raw_connection
          pg_connection.server_version >= 10_00_00
        end

        private

        def undecorated_connection
          __getobj__
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fx-0.9.0 lib/fx/adapters/postgres/connection.rb