Class: PersonLifetimeValueJob

Inherits:
Object
  • Object
show all
Defined in:
app/models/job/person_lifetime_value_job.rb

Instance Method Summary collapse

Instance Method Details

#performObject



2
3
4
5
6
7
8
9
# File 'app/models/job/person_lifetime_value_job.rb', line 2

def perform
  Person.includes(:orders => :items).find_each do |p|
    p.skip_commit = true
    p.calculate_lifetime_value
    p.calculate_lifetime_donations
  end
  Sunspot.delay.commit
end