Module: Sidekiq::Apriori::Arb::ClassMethods

Defined in:
lib/sidekiq-apriori/arb.rb

Instance Method Summary collapse

Instance Method Details

#prioritize(options = {}, &block) ⇒ Object

Declarative hook to prioritize instances



19
20
21
22
23
24
# 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