module WithTransactionalLock::Mixin::AdvisoryLockClassLocator

Public Class Methods

locate(connection) click to toggle source
# File lib/with_transactional_lock/mixin.rb, line 21
def self.locate(connection)
  adapter = connection.adapter_name.downcase.to_sym
  case adapter
    when :mysql, :mysql2
      MySqlAdvisoryLock
    when :postgresql
      PostgresAdvisoryLock
    else
      raise "adapter not supported: #{adapter}"
  end
end