Sha256: a7fb37d549e10b3b11f17f37f476b56e0a192b168a652aa154cfa74997d38315

Contents?: true

Size: 653 Bytes

Versions: 4

Compression:

Stored size: 653 Bytes

Contents

module Apartment

  module Database
    def self.jdbc_mysql_adapter(config)
      Adapters::JDBCMysqlAdapter.new config
    end
  end

  module Adapters
    class JDBCMysqlAdapter < AbstractJDBCAdapter

      protected

      #   Connect to new database
      #   Abstract adapter will catch generic ActiveRecord error
      #   Catch specific adapter errors here
      #
      #   @param {String} database Database name
      #
      def connect_to_new(database)
        super
      rescue DatabaseNotFound
        Apartment::Database.reset
        raise DatabaseNotFound, "Cannot find database #{environmentify(database)}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
apartment-0.22.1 lib/apartment/adapters/jdbc_mysql_adapter.rb
apartment-0.22.0 lib/apartment/adapters/jdbc_mysql_adapter.rb
apartment-0.21.1 lib/apartment/adapters/jdbc_mysql_adapter.rb
apartment-0.21.0 lib/apartment/adapters/jdbc_mysql_adapter.rb