module Sidekiq::Apriori::Arb::ClassMethods

Public Instance Methods

prioritize(options = {}, &block) click to toggle source

Declarative hook to prioritize instances

# File lib/sidekiq-apriori/arb.rb, line 19
def prioritize(options = {}, &block)
  method = ( block_given? && [-1, 0].include?(block.arity) ) ?
    block : ( options[:using] || options[:with] )

  before_validation method, :on => :create
end