Module: Counter::SidekiqReconciliation

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/counter/sidekiq_reconciliation.rb

Defined Under Namespace

Classes: Any

Instance Method Summary collapse

Instance Method Details

#add_item(item) ⇒ Object

Support for background reconciliation



5
6
7
8
# File 'app/models/concerns/counter/sidekiq_reconciliation.rb', line 5

def add_item item
  record_counter_change
  enqueue_reconcilitation_job
end

#remove_item(item) ⇒ Object



15
16
17
18
# File 'app/models/concerns/counter/sidekiq_reconciliation.rb', line 15

def remove_item item
  record_counter_change amount: -1
  enqueue_reconcilitation_job
end

#update_item(item) ⇒ Object



10
11
12
13
# File 'app/models/concerns/counter/sidekiq_reconciliation.rb', line 10

def update_item item
  record_counter_change amount: 1
  enqueue_reconcilitation_job
end