instance method connect

Ruby on Rails 3.2.22.5

Since v3.1.12 Last seen in v4.2.9 Private

Available in: v3.1.12 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9

Signature

connect()

No documentation comment.

Source
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 397
      def connect
        encoding = @config[:encoding]
        if encoding
          @connection.options(Mysql::SET_CHARSET_NAME, encoding) rescue nil
        end

        if @config[:sslca] || @config[:sslkey]
          @connection.ssl_set(@config[:sslkey], @config[:sslcert], @config[:sslca], @config[:sslcapath], @config[:sslcipher])
        end

        @connection.options(Mysql::OPT_CONNECT_TIMEOUT, @config[:connect_timeout]) if @config[:connect_timeout]
        @connection.options(Mysql::OPT_READ_TIMEOUT, @config[:read_timeout]) if @config[:read_timeout]
        @connection.options(Mysql::OPT_WRITE_TIMEOUT, @config[:write_timeout]) if @config[:write_timeout]

        @connection.real_connect(*@connection_options)

        # reconnect must be set after real_connect is called, because real_connect sets it to false internally
        @connection.reconnect = !!@config[:reconnect] if @connection.respond_to?(:reconnect=)

        configure_connection
      end

Defined in activerecord/lib/active_record/connection_adapters/mysql_adapter.rb line 397 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Mysql::Stmt::ActiveRecord::ConnectionAdapters::MysqlAdapter

Type at least 2 characters to search.

↑↓ navigate · open · esc close