module ActiveJob::Uniqueness::Strategies

See Configuration#lock_strategies if you want to define custom strategy

Public Class Methods

lookup(strategy) click to toggle source
# File lib/active_job/uniqueness/strategies.rb, line 17
def lookup(strategy)
  matching_strategy(strategy.to_s.camelize) ||
    ActiveJob::Uniqueness.config.lock_strategies[strategy] ||
    raise(StrategyNotFound, "Strategy '#{strategy}' is not found. Is it declared in the configuration?")
end

Private Class Methods

matching_strategy(const) click to toggle source
# File lib/active_job/uniqueness/strategies.rb, line 25
def matching_strategy(const)
  const_get(const, false) if const_defined?(const, false)
end